Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/digitalsparky/jekyll-minifier
Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor
https://github.com/digitalsparky/jekyll-minifier
htmlcompressor jekyll jekyll-minifier jekyll-plugin minifies ruby ruby-gem
Last synced: 7 days ago
JSON representation
Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor
- Host: GitHub
- URL: https://github.com/digitalsparky/jekyll-minifier
- Owner: digitalsparky
- License: gpl-3.0
- Created: 2015-01-08T11:37:22.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-07-13T23:37:04.000Z (5 months ago)
- Last Synced: 2024-10-29T17:25:47.482Z (about 1 month ago)
- Topics: htmlcompressor, jekyll, jekyll-minifier, jekyll-plugin, minifies, ruby, ruby-gem
- Language: Ruby
- Size: 70.3 KB
- Stars: 245
- Watchers: 10
- Forks: 25
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-jekyll-plugins - **Minifier** - minifier](https://rubygems.org/gems/jekyll-minifier)) -- minifies HTML, XML, CSS, and Javascript both inline and as separate files utilising yui-compressor and htmlcompressor. (Assets & Converters & Minifiers)
README
# jekyll-minifier [![Build Status](https://travis-ci.org/digitalsparky/jekyll-minifier.svg?branch=master)](https://travis-ci.org/digitalsparky/jekyll-minifier) [![Gem Version](https://badge.fury.io/rb/jekyll-minifier.svg)](http://badge.fury.io/rb/jekyll-minifier)
Requires Ruby 2.3+
Minifies HTML, XML, CSS, JSON and JavaScript both inline and as separate files utilising yui-compressor and htmlcompressor.
This was created due to the previous minifier (jekyll-press) not being CSS3 compatible, which made me frown.
Note: this is my first ever gem, I'm learning, so feedback is much appreciated.
** This minifier now only runs when JEKYLL_ENV="production" is set in the environment **
Easy to use, just install the jekyll-minifier gem:
gem install jekyll-minifier
Then add this to your \_config.yml:
plugins:
- jekyll-minifierOptionally, you can also add exclusions using:
jekyll-minifier:
exclude: 'atom.xml' # Exclude files from processing - file name, glob pattern or array of file names and glob patternsand toggle features and settings using:
jekyll-minifier:
preserve_php: true # Default: false
remove_spaces_inside_tags: true # Default: true
remove_multi_spaces: true # Default: true
remove_comments: true # Default: true
remove_intertag_spaces: true # Default: false
remove_quotes: false # Default: false
compress_css: true # Default: true
compress_javascript: true # Default: true
compress_json: true # Default: true
simple_doctype: false # Default: false
remove_script_attributes: false # Default: false
remove_style_attributes: false # Default: false
remove_link_attributes: false # Default: false
remove_form_attributes: false # Default: false
remove_input_attributes: false # Default: false
remove_javascript_protocol: false # Default: false
remove_http_protocol: false # Default: false
remove_https_protocol: false # Default: false
preserve_line_breaks: false # Default: false
simple_boolean_attributes: false # Default: false
compress_js_templates: false # Default: false
preserve_patterns: # Default: (empty)
uglifier_args: # Default: (empty)js_args can be found in the the uglifier documentation at listed below
Note: es6 has been implemented as experimental only via the upstream uglifier package.
See https://github.com/lautis/uglifier for more information.To enable es6 syntax use:
jekyll-minifier:
uglifier_args:
harmony: true# Like my stuff?
Would you like to buy me a coffee or send me a tip?
While it's not expected, I would really appreciate it.[![Paypal](https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png)](https://paypal.me/MattSpurrier)