Sha256: 4278213b73a6af9ca92b6adcf2bf6e8b7c620d31062ec55df68dedf2be1e5021
Contents?: true
Size: 1.48 KB
Versions: 35
Compression:
Stored size: 1.48 KB
Contents
# ------------------------------------------------------------------------------ # ~/_plugins/minifyJSON.rb # Liquid filter for J1 Theme to minify a JSON string # # Product/Info: # http://jekyll.one # # Copyright (C) 2023 Juergen Adams # # J1 Theme is licensed under the MIT License. # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md # ------------------------------------------------------------------------------ # => 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
35 entries across 35 versions & 1 rubygems