Created
February 21, 2022 14:25
-
-
Save onliniak/304ad57f8e6558c5a5972ea72d929a33 to your computer and use it in GitHub Desktop.
Liquid partials
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat /templates/_product.liquid | |
ABC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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