Sha256: 0939b350b8229edf1975c1c02bf102017f3d895530bd97a7674e48db2a3260dc
Contents?: true
Size: 1.01 KB
Versions: 12
Compression:
Stored size: 1.01 KB
Contents
# ------------------------------------------------------------------------------ # ~/_plugins/filter/xml_prettify.rb # Liquid filter for J1 Theme to beautify XML code # # Product/Info: # http://jekyll.one # # Copyright (C) 2023, 2024 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md # ------------------------------------------------------------------------------ # 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 XML output goes here # # {% endcapture %} # {{ cache_name | xml_pretty_print }} # ------------------------------------------------------------------------------ require 'nokogiri' module Jekyll module XmlPrettyPrint def xml_pretty_print(input) # xml cleanup Nokogiri::XML(input).root.to_xml end end end Liquid::Template.register_filter(Jekyll::XmlPrettyPrint)
Version data entries
12 entries across 12 versions & 1 rubygems