Reputation: 2038
I use {% include text.md %}
in my posts to include some often typed paragraphs.
I have a Generator
plugin that makes some text replacement in post contents.
However, the text inside the included files (e.g. text.md
) is not processed by this plugin.
How can I run the plugin after includes are performed but before html is rendered? Or how could I do things differently to make it work?
Upvotes: 0
Views: 180
Reputation: 5434
Jekyll processes a site in distinct "phases".
reset >> read >> generate >> render >> cleanup >> write
A Generator
subclass is generally used to "generate" objects (Pages or Documents) that are then rendered based on the priority
defined for the generator.
An include tag (or any Liquid constructs) is "rendered" in the subsequent phase.
Unfortunately, you cannot alter the "raw content" of a file in the middle of the rendering phase.
Jekyll provides you with just a :pre_render
hook to manipulate unrendered content of a file.
Upvotes: 2