A new HTML minifier plug-in

I created a new plug-in that minifies the HTML generated by Jekyll. It is available at github.com/gandaro/jekyll-minify-html-rs. The README on that page explains how you can install it.

The plug-in uses the minify-html package that was written in Rust.

On my Jekyll site the minifier reduced the uncompressed HTML file size by about 50%. However that is not a fair metric. If your HTTP server is set up correctly, it will apply a lossless compression algorithm on the transmitted data, for example Brotli, which will reduce the relative savings of the minifier a lot. In my case, the savings for Brotli-compressed HTML were between 14 and 18 %, so still significant.

I hope that some of you will find it useful.

The source code for the plug-in can also be viewed as a minimal example of a Jekyll plug-in, maybe it is useful for someone who just wants to see how to create a simple plug-in.

1 Like