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:
- Install the gem by running the following command:
gem install jekyll-minifier
- Add the following code to your
_config.ymlfile:
gems:
- jekyll-minifier
- Optionally, you can add exclusions using the following code:
jekyll-minifier:
exclude:
- path/to/exclude
- 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.