HTML5small is a general-purpose minifier for HTML5 documents.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
fixtures
lib
spec
.document
.gitignore
LICENSE
README.md
Rakefile
VERSION
html5small.gemspec

README.md

HTML5small

HTML5small is a general-purpose minifier for HTML5 documents.
It is faster than html_compressor and at the same time compresses much better, while still generating valid HTML5.

Usage

$ gem install html5small
require 'html5small'
::HTML5.minify '<html>...</html>'

As a nanoc filter

HTML5small can also be used as a nanoc filter. This will lead to even faster loading of your compiled sites.

To use the HTML5small filter, add this line to your lib/helpers.rb:

require 'html5small/nanoc'

Then adapt your Rules to apply the filter where necessary. For example:

compile '/blog/*/' do
  filter :erb
  filter :html5small
end

Origin

HTML5small is based on h5-min, which is currently unmaintained.