www-from-model/page_templates/person.md.j2
Stephan Heunis b104cca870 Only add necessary keys to frontmatter
This goes along with a change to qri, where the data is included as a
python dictionary at a specific key, and the toyaml filter is made
available to the jinja template. The jinja template then extracts the
keys that it needs and adds it to a dictionary, then runs it through
the toyaml filter to add everything to frontmatter
2026-03-07 14:34:10 +01:00

12 lines
No EOL
348 B
Django/Jinja

---
title: {{ given_name }} {{ family_name }}
params:
{%- set fields = ["given_name", "family_name", "identifiers", "description"] %}
{%- set p = {} %}
{%- for f in fields %}
{%- if f in param_context and param_context[f] %}
{%- set _ = p.update({f: param_context[f]}) %}
{%- endif %}
{%- endfor %}
{{ p | toyaml | indent(2) | trim }}
---