This Jekyll plugin creates an uglify
Liquid Template filter. I use it to minify JavaScript for inlining.
_plugins/uglify.rb
to your Jekyll site's _plugins
directory_config.yml
file:plugins:
- uglifier
gem "uglifier"
to your Gemfilebundle install
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>