# A simple way to inspect liquid template variables.# Usage:# Can be used anywhere liquid syntax is parsed (templates, includes, posts/pages)# {{ site | debug }}# {{ site.posts | debug }}#require'pp'moduleJekyll# Need to overwrite the inspect method here because the original# uses < > to encapsulate the psuedo post/page objects in which case# the output is taken for HTML tags and hidden from view.#classPostdefinspect"#Jekyll:Post @id=#{self.id.inspect}"endendclassPagedefinspect"#Jekyll:Page @name=#{self.name.inspect}"endendend# JekyllmoduleJekyllmoduleDebugFilterdefdebug(obj,stdout=false)putsobj.pretty_inspectifstdout"<pre>#{obj.class}\n#{obj.pretty_inspect}</pre>"endend# DebugFilterend# JekyllLiquid::Template.register_filter(Jekyll::DebugFilter)