docs: Liquid is not rendered in front matter

props: @beep @ashmaroli
This commit is contained in:
Frank Taillandier
2020-07-06 23:09:01 +02:00
committed by GitHub
parent bbde471f53
commit b6b8c0379f

View File

@@ -20,7 +20,7 @@ Between these triple-dashed lines, you can set predefined variables (see below
for a reference) or even create custom ones of your own. These variables will
then be available for you to access using Liquid tags both further down in the
file and also in any layouts or includes that the page or post in question
relies on.
relies on.
<div class="note warning">
<h5>UTF-8 Character Encoding Warning</h5>
@@ -137,6 +137,30 @@ food: Pizza
```
{% endraw %}
Liquid does _not_ render when embedded in front matter.
For example if you have a liquid tag in a front matter value:
{% raw %}
```liquid
---
title: Post title
intro: This is a follow up of [this other post]{% link _posts/2020-01-01-previously.md %}).
---
```
{% endraw %}
You need to `capture` the Liquid expression first, before rendering it to Markdown.
{% raw %}
```liquid
{% capture intro %}{{ page.info }}{% endcapture %}
{{ intro | markdownify }}
```
{% endraw %}
## Predefined Variables for Posts
These are available out-of-the-box to be used in the front matter for a post.