Well this is probably kind of a silly question but I\'m wondering if there\'s any way to have the generated markup in Jekyll to preserve the indentation of the Liquid-tag. World
We can accomplish this by writing a custom Liquid filter to tidy the html, and then doing {{content | tidy }}
to include the html.
A quick search suggests that the ruby tidy gem may not be maintained but that nokogiri is the way to go. This will of course mean installing the nokogiri gem.
See advice on writing liquid filters, and Jekyll example filters.
An example might look something like this: in _plugins
, add a script called tidy-html.rb containing:
require 'nokogiri'
module TextFilter
def tidy(input)
desired = Nokogiri::HTML::DocumentFragment.parse(input).to_html
end
end
Liquid::Template.register_filter(TextFilter)
(Untested)