Skip to content

Instantly share code, notes, and snippets.

@onliniak
Created February 21, 2022 14:25
Show Gist options
  • Save onliniak/304ad57f8e6558c5a5972ea72d929a33 to your computer and use it in GitHub Desktop.
Save onliniak/304ad57f8e6558c5a5972ea72d929a33 to your computer and use it in GitHub Desktop.
Liquid partials
# cat /templates/_product.liquid
ABC
require 'liquid'
Liquid::LocalFileSystem.new('templates')
template = Liquid::Template.parse("{% include 'product' %}")
pp template.render #=> ABC
# Important: _FILENAME.liquid
# with _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment