Skip to content

Instantly share code, notes, and snippets.

@kerotaa
Created August 22, 2013 10:13
Show Gist options
  • Save kerotaa/6305496 to your computer and use it in GitHub Desktop.
Save kerotaa/6305496 to your computer and use it in GitHub Desktop.
a jekyll plugin that compress html files
require 'html_press'
module Jekyll
module Convertible
def write(dest)
path = destination(dest)
FileUtils.mkdir_p(File.dirname(path))
if File.extname(path).downcase == '.html' then
self.output = HtmlPress.press self.output
end
File.open(path, 'w') do |f|
f.write( self.output )
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment