Merge pull request #22 from pathawks/liquid-once
Only process Liquid template once
This commit is contained in:
commit
7a0ee09e22
|
@ -11,7 +11,7 @@ module Jekyll
|
|||
|
||||
def render(context)
|
||||
@context = context
|
||||
output = Liquid::Template.parse(template_contents).render!(payload, info)
|
||||
output = template.render!(payload, info)
|
||||
|
||||
# Encode smart quotes. See https://github.com/benbalter/jekyll-seo-tag/pull/6
|
||||
output.gsub!(HTML_ESCAPE_REGEX, HTML_ESCAPE)
|
||||
|
@ -35,6 +35,10 @@ module Jekyll
|
|||
}
|
||||
end
|
||||
|
||||
def template
|
||||
@template ||= Liquid::Template.parse template_contents
|
||||
end
|
||||
|
||||
def template_contents
|
||||
@template_contents ||= File.read(template_path).gsub(/(>\n|[%}]})\s+(<|{[{%])/,'\1\2').chomp
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue