More Premium Hugo Themes Premium Jekyll Themes

Jekyll Minifier

Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor

Jekyll Minifier

Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor

Author Avatar Theme by digitalsparky
Github Stars Github Stars: 258
Last Commit Last Commit: Sep 12, 2025 -
First Commit Created: Dec 18, 2023 -
Jekyll Minifier screenshot

Overview

The jekyll-minifier gem is a tool used for minifying HTML, XML, CSS, JSON, and JavaScript files. It is designed to be easy to use and is compatible with Ruby 2.3 or higher. This gem was created as a CSS3 compatible alternative to the previous minifier, jekyll-press. Feedback is appreciated as the developer is still learning.

Features

  • Minifies HTML, XML, CSS, JSON, and JavaScript files
  • Supports both inline and separate file minification
  • Utilizes yui-compressor and htmlcompressor for compression

Installation

To install the jekyll-minifier gem, follow these steps:

  1. Install the gem by running the following command:
gem install jekyll-minifier
  1. Add the following code to your _config.yml file:
gems:
  - jekyll-minifier
  1. Optionally, you can add exclusions using the following code:
jekyll-minifier:
  exclude:
    - path/to/exclude
  1. Toggle features and settings using the following code:
jekyll-minifier:
  feature1: true
  feature2: false

Note: The js_args for JavaScript minification can be found in the uglifier documentation provided at a given link. It is worth mentioning that the implementation of es6 syntax is experimental and is only available via the upstream uglifier package.

Summary

The jekyll-minifier gem is a minification tool that can be easily installed and used with Jekyll projects. It supports the minification of various file types and offers features such as exclusions and toggling. The gem is continuously being developed, and feedback is appreciated to improve its functionality.