www-from-model/page_templates/person.md.j2
Stephan Heunis bedbe5733c
All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 1m15s
Use jinja for parameter injection and hugo template for person page
This uses the new '__rec' property of 'query-things' 'render_record' command
to extract values for explicitly defined keys and inject them under 'params'
in the markdown page front matter. This makes them available to a hugo
template under '.Params'.

A new 'layouts/_default/person.html' template is now responsible for rendering
everything on a person page. This allows using hugo's bundle resources to easily
check e.g. if there is a portrait of the person in the bundle. The template
renders everything that was previously rendered from the _index.md page, and will
put the portrait and graph side by side if a portrait exists, otherwise the graph
will display full-width. A snippet from the congo theme is included at the end of
the template in order to render all taxonomy related terms.
2026-03-19 16:17:32 +01:00

13 lines
355 B
Django/Jinja

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