Sha256: 9cf1028e5fc89462f023c4b2ccb9fa60e75094dfb5dc9cae15e0ca17c02c776a
Contents?: true
Size: 1.49 KB
Versions: 40
Compression:
Stored size: 1.49 KB
Contents
# ------------------------------------------------------------------------------ # ~/_plugins/minifyJSON.rb # Liquid filter for J1 Template to minify a JSON string # # Product/Info: # http://jekyll.one # # Copyright (C) 2022 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
40 entries across 40 versions & 1 rubygems