Minify template just once

This commit is contained in:
Pat Hawks 2016-01-06 12:29:14 -08:00
parent 660249140d
commit 7a55460f2c
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
1 changed files with 1 additions and 4 deletions

View File

@ -13,9 +13,6 @@ module Jekyll
@context = context
output = Liquid::Template.parse(template_contents).render!(payload, info)
# Minify
output.gsub!(/[\s]{2,}/, "\n")
# Encode smart quotes. See https://github.com/benbalter/jekyll-seo-tag/pull/6
output.gsub!(HTML_ESCAPE_REGEX, HTML_ESCAPE)
@ -39,7 +36,7 @@ module Jekyll
end
def template_contents
@template_contents ||= File.read(template_path)
@template_contents ||= File.read(template_path).gsub(/(>\n|[%}]})\s+(<|{[{%])/,'\1\2').chomp
end
def template_path