diff --git a/.forgejo/workflows/update_person_pages.yaml b/.forgejo/workflows/update_person_pages.yaml index f241457..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 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/layouts/_default/person.html b/layouts/_default/person.html new file mode 100644 index 0000000..c436f06 --- /dev/null +++ b/layouts/_default/person.html @@ -0,0 +1,73 @@ +{{ 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 }} +
+ {{ 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 }} diff --git a/page_templates/person.md.j2 b/page_templates/person.md.j2 index 20f243f..7b1430a 100644 --- a/page_templates/person.md.j2 +++ b/page_templates/person.md.j2 @@ -1,16 +1,12 @@ --- 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: +{%- 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