Is it possible to add custom nested metadata keys in Pelican md file?

19 views Asked by At

I'd like to do something like this:

---
title: My Page
friends:
  - name: John
  surname: Smith
  - name: Ana
  surname: Jones
---

to use it in the template:

{% for friends in page.friends %}
  <p>{{ friend.name }}</p>
{% endfor %}

But it seems to be treated as a content and generated as a list:

<ul>
  <li>John</li>
  <li>Smith</li>
  <li>Ana</li>
  <li>Jones</li>
</ul>

Pelican documentation says that it is possible to use custom markdown key, how to do it?

1

There are 1 answers

0
Malvinka On

Looks like Pelican needs an additional plugin to recognise YAML headers. Adding https://github.com/pR0Ps/pelican-yaml-metadata helped.