Skip to content

Commit

Permalink
Merge pull request #20 from pathawks/minify-once
Browse files Browse the repository at this point in the history
Minify template just once
  • Loading branch information
pathawks committed Jan 7, 2016
2 parents 6602491 + 7a55460 commit 860b8b9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/jekyll-seo-tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ def render(context)
@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)

Expand All @@ -39,7 +36,7 @@ def info
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
Expand Down

0 comments on commit 860b8b9

Please # to comment.