layout | title |
---|---|
snippet |
liquify Filter - Use Liquid Placeholders in Front Matter Values |
Add a new filter that lets you use liquid in your front matter block. Example:
---
title: How to install {% raw %}{{ site.data.placeholder.product-name }}{% endraw %}
---
And the filter:
module LiquidFilter
def liquify(input)
Liquid::Template.parse(input).render(@context)
end
end
Liquid::Template.register_filter(LiquidFilter)
Use it in your templates / layouts like:
{% raw %}
{{ page.title | liquify }}
{% endraw %}
- Jekyll filter: Use Liquid in front-matter by Stefan Baumgartner