Skip to content

Instantly share code, notes, and snippets.

@dutygeeks
dutygeeks / html_compressor.rb
Created February 28, 2012 23:16 — forked from seth/yui_compressor.rb
HTML COMPRESSOR
class Htmlcompressor < Nanoc3::Filter
identifier :htmlcompressor
type :text => :binary
def run(content, params={})
case @item[:extension]
when "xml.erb"
cmd = "htmlcompressor --type xml -o #{output_filename}"
class Optipng < Nanoc3::Filter
identifier :optipng
type :binary
def run(filename, params={})
system(
'optipng',
'-quiet',
'-o', params[:level].to_s,
filename,
class Smusher < Nanoc3::Filter
identifier :smusher
type :binary
# "output_finename"
def run(filename, params={})
system(