Merge pull request #20 from pathawks/minify-once

Minify template just once
This commit is contained in:
Pat Hawks 2016-01-06 18:32:21 -08:00
commit 860b8b9a2c
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