Skip to content

Instantly share code, notes, and snippets.

@ramontayag
Created December 17, 2010 03:56
Show Gist options
  • Save ramontayag/744465 to your computer and use it in GitHub Desktop.
Save ramontayag/744465 to your computer and use it in GitHub Desktop.
module LiquidTemplatingHelper
def liquidize(content, args)
Liquid::Template.parse(content).render(args, :filters => [LiquidFilters])
end
def liquidize_snippets(snippettable)
text = ""
snippettable.scheme.snippets.each do |snippet|
s = div_for(snippet) { liquidize(snippet.content, 'object' => snippettable, 'images' => current_site.images.all) }
text << s
end
text
end
end
= div_for @page do
!= liquidize_snippets(@page)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment