From e9461ce9cb890cd42507b47a2fe5d71ff12bb671 Mon Sep 17 00:00:00 2001 From: Stephan Heunis Date: Wed, 4 Mar 2026 22:46:48 +0100 Subject: [PATCH 1/3] person-pages update: use params and hugo html template This introduces a different approach to generating the person pages. It depends on an update to 'qri' that allows exposing a full metadata record as YAML to the template in the 'render-record' command. This allows injecting the full metadata record into the markdown front matter under the 'params' key, which makes all record properties accessible to hugo templating under '.Params'. This meant a change to the person jinja template: everything goes into the front matter and jinja is not used anymore for content rendering. It also meant introducing a new hugo html template that contains all page rendering logic. This logic mimics the previous jinja logic, but also includes a snippet to render a portrait image if an image file matching 'portrait.*' is found in the page bundle, i.e. alongside the '_index.md' file. --- .forgejo/workflows/update_person_pages.yaml | 2 +- layouts/_default/person.html | 46 +++++++++++++++++++++ page_templates/person.md.j2 | 17 ++------ 3 files changed, 50 insertions(+), 15 deletions(-) create mode 100644 layouts/_default/person.html diff --git a/.forgejo/workflows/update_person_pages.yaml b/.forgejo/workflows/update_person_pages.yaml index f241457..0dce57e 100644 --- a/.forgejo/workflows/update_person_pages.yaml +++ b/.forgejo/workflows/update_person_pages.yaml @@ -40,6 +40,6 @@ jobs: dtc get-records ${DUMPTHINGS_APIURL} public -C XYZPerson \ | qri filter-linked-pid public xyzrins:. associated_with \ | qri inline-records -c public -p delegated_by -p delegated_by::roles -p identifiers::creator \ - | qri render-record page_templates/person.md.j2 'content/{__pid_curie_reference}/_index.md' + | qri render-record --include-data-at-key params page_templates/person.md.j2 'content/{__pid_curie_reference}/_index.md' - name: Deposit changes uses: ./.forgejo/actions/deposit-changes diff --git a/layouts/_default/person.html b/layouts/_default/person.html new file mode 100644 index 0000000..a5fe464 --- /dev/null +++ b/layouts/_default/person.html @@ -0,0 +1,46 @@ +{{ define "main" }} +
+
+

{{ .Params.given_name }} {{ .Params.family_name }}

+
+ + {{ $portraits := .Resources.Match "portrait.*" }} + {{ with index $portraits 0 }} + Portrait of {{ $.Params.given_name }} {{ $.Params.family_name }} + {{ end }} + + {{ with .Params.description }} +

{{ . }}

+ {{ end }} + + {{ $links := dict + "Debian" "https://qa.debian.org/developer.php?login=%s" + "GitHub" "https://github.com/%s" + "LinkedIn" "https://www.linkedin.com/in/%s" + "ORCID" "https://orcid.org/%s" + "ResearchGate" "https://www.researchgate.net/profile/%s" + }} + {{ with .Params.identifiers }} + + {{ end }} +
+{{ end }} diff --git a/page_templates/person.md.j2 b/page_templates/person.md.j2 index 20f243f..9400a45 100644 --- a/page_templates/person.md.j2 +++ b/page_templates/person.md.j2 @@ -1,16 +1,5 @@ --- title: {{ given_name }} {{ family_name }} ---- - -{{ description }} - -{%- for identifier in identifiers if identifier.creator.name is defined -%} -{%- if description is defined and loop.first %}{{ '\n\n' }}{% endif -%} -{% if identifier.creator.name == "Debian" %}- [Debian: {{ identifier.notation }}](https://qa.debian.org/developer.php?login={{ identifier.notation }}) -{% elif identifier.creator.name == "GitHub" %}- [GitHub: {{ identifier.notation }}](https://github.com/{{ identifier.notation }}) -{% elif identifier.creator.name == "LinkedIn" %}- [LinkedIn: {{ identifier.notation }}](https://www.linkedin.com/in/{{ identifier.notation }}) -{% elif identifier.creator.name == "ORCID" %}- [ORCID: {{ identifier.notation }}](https://orcid.org/{{ identifier.notation }}) -{% elif identifier.creator.name == "ResearchGate" %}- [ResearchGate: {{ identifier.notation }}](https://www.researchgate.net/profile/{{ identifier.notation }}) -{% else %}- {{ identifier.creator.name }}: {{ identifier.notation }} -{% endif %} -{%- endfor -%} +params: + {{ params | indent(2) }} +--- \ No newline at end of file -- 2.52.0 From b104cca870dc763bf0ec425426cfb156bf95e698 Mon Sep 17 00:00:00 2001 From: Stephan Heunis Date: Sat, 7 Mar 2026 14:34:10 +0100 Subject: [PATCH 2/3] 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 --- .forgejo/workflows/update_person_pages.yaml | 2 +- page_templates/person.md.j2 | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/update_person_pages.yaml b/.forgejo/workflows/update_person_pages.yaml index 0dce57e..e185caa 100644 --- a/.forgejo/workflows/update_person_pages.yaml +++ b/.forgejo/workflows/update_person_pages.yaml @@ -40,6 +40,6 @@ jobs: dtc get-records ${DUMPTHINGS_APIURL} public -C XYZPerson \ | qri filter-linked-pid public xyzrins:. associated_with \ | qri inline-records -c public -p delegated_by -p delegated_by::roles -p identifiers::creator \ - | qri render-record --include-data-at-key params page_templates/person.md.j2 'content/{__pid_curie_reference}/_index.md' + | qri render-record --include-data-at-key param_context page_templates/person.md.j2 'content/{__pid_curie_reference}/_index.md' - name: Deposit changes uses: ./.forgejo/actions/deposit-changes diff --git a/page_templates/person.md.j2 b/page_templates/person.md.j2 index 9400a45..7b1430a 100644 --- a/page_templates/person.md.j2 +++ b/page_templates/person.md.j2 @@ -1,5 +1,12 @@ --- title: {{ given_name }} {{ family_name }} params: - {{ params | indent(2) }} +{%- 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 }} --- \ No newline at end of file -- 2.52.0 From 8d958659eddd75aa357022cbf28292f65275d3f7 Mon Sep 17 00:00:00 2001 From: Stephan Heunis Date: Sat, 7 Mar 2026 14:34:44 +0100 Subject: [PATCH 3/3] more conformant to congo theme approach, also include related terms/taxonomies --- layouts/_default/person.html | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/layouts/_default/person.html b/layouts/_default/person.html index a5fe464..c436f06 100644 --- a/layouts/_default/person.html +++ b/layouts/_default/person.html @@ -1,5 +1,5 @@ {{ define "main" }} -
+

{{ .Params.given_name }} {{ .Params.family_name }}

@@ -42,5 +42,32 @@ {{ end }} {{ end }} -
+ + {{ if .Data.Pages }} +
+
+ {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} + {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} +

+ {{ .Key }} +

+
+ {{ range .Pages }} + {{ partial "article-link.html" . }} + {{ end }} + {{ end }} + {{ else }} + {{ range (.Paginate .Pages).Pages }} + {{ partial "article-link.html" . }} + {{ end }} + {{ end }} +
+ {{ partial "pagination.html" . }} + {{ else }} +
+

+ {{ i18n "list.no_articles" | emojify }} +

+
+ {{ end }} {{ end }} -- 2.52.0