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
12 lines
No EOL
348 B
Django/Jinja
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 }}
|
|
--- |