Sha256: 3df6e7b7d59db3d1d778d25e48300d2b5afd50ec4eb026fc4f1f34d7ba533454
Contents?: true
Size: 1.47 KB
Versions: 14
Compression:
Stored size: 1.47 KB
Contents
# ------------------------------------------------------------------------------ # ~/_plugins/uglify.rb # Liquid filter for J1 Template to uglify JS # # Product/Info: # http://jekyll.one # # Copyright (C) 2020 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE # ------------------------------------------------------------------------------ # => Uglifier.compile(File.read(input)) # ------------------------------------------------------------------------------ # NOTE: # CustomFilters cannot be used in SAFE mode (e.g not usable for # rendering pages with Jekyll on GitHub # # USAGE: # {% capture cache_name %} # # liquid code to generate HTML output goes here # # {% endcapture %} # {{ cache_name | uglify }} # ------------------------------------------------------------------------------ # noinspection SpellCheckingInspection # rubocop:disable Lint/UnneededDisable # rubocop:disable Style/Documentation # rubocop:disable Metrics/LineLength # rubocop:disable Layout/TrailingWhitespace # rubocop:disable Layout/SpaceAroundOperators # rubocop:disable Layout/ExtraSpacing # rubocop:disable Metrics/AbcSize # ------------------------------------------------------------------------------ require 'json/minify' module Jekyll module MinifyJSON def minifyJSON(input) minified = JSON.minify(input) input = minified end end end Liquid::Template.register_filter(Jekyll::MinifyJSON)
Version data entries
14 entries across 14 versions & 1 rubygems