This Jekyll plugin creates an uglify Liquid Template filter. I use it to minify JavaScript for inlining.
Ruby
Switch branches/tags
Nothing to show
Clone or download
Latest commit 6ea61b4 Apr 11, 2018
Permalink
Failed to load latest commit information.
_plugins Add everything Sep 19, 2016
.gitignore Add everything Sep 19, 2016
README.md fix documentation Apr 10, 2018

README.md

Jekyll Uglify Filter

This Jekyll plugin creates an uglify Liquid Template filter. I use it to minify JavaScript for inlining.

Installation

  1. Add _plugins/uglify.rb to your Jekyll site's _plugins directory
  2. Add this to Jekyll's _config.yml file:
plugins:
  - uglifier
  1. Add gem "uglifier" to your Gemfile
  2. Run bundle install

Usage

The uglify filter runs a string of JavaScript through the Uglifier Gem and returns it. I use it to minify JavaScript for inlining:

{% capture scripts %}
  {% include main.js %}
{% endcapture %}
<script>{{ scripts | uglify | strip }}</script>