176139da59
* speed up compilation of html pages in production * who needs all of that latex * add latex-fonts-recommended * math package * how far can we push this * just trimming off some little excess * never mind, good enough
14 lines
475 B
Ruby
14 lines
475 B
Ruby
require 'htmlcompressor'
|
|
require 'rainpress'
|
|
require 'uglifier'
|
|
|
|
class UglifyProxy < Uglifier
|
|
alias_method :compress, :compile
|
|
end
|
|
|
|
JS_COMPRESSOR = UglifyProxy.new
|
|
CSS_COMPRESSOR = Rainpress
|
|
|
|
Nanoc::Filter.define(:html_press) do |content, options|
|
|
HtmlCompressor::Compressor.new(compress_javascript: true, javascript_compressor: JS_COMPRESSOR, compress_css: true, css_compressor: CSS_COMPRESSOR, remove_quotes: true, simple_boolean_attributes: true).compress content
|
|
end
|