diff --git a/layouts/_default/person.html b/layouts/_default/person.html new file mode 100644 index 0000000..107c83f --- /dev/null +++ b/layouts/_default/person.html @@ -0,0 +1,108 @@ +{{ define "main" }} +
+ {{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }} + {{ partial "breadcrumbs.html" . }} + {{ end }} + {{ if and .Params.given_name .Params.family_name }} +

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

+ {{ else }} +

{{ .Title }}

+ {{ end }} +
+
+ + {{ $portraits := .Resources.Match "portrait.*" }} + {{ $hasPortrait := gt (len $portraits) 0 }} + + + {{ if $hasPortrait }} + + {{ end }} + + +
+ {{ with index $portraits 0 }} + Portrait of {{ $.Params.given_name }} {{ $.Params.family_name }} + {{ end }} + + {{ if .Param "graphRootNodePID" | default false }} +
+ + +
+ {{ if .Param "graphDescription" | default false }} +

{{ .Param "graphDescription" }}

+ {{ end }} +
+
+
+
+
+
+ {{ 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 }} \ No newline at end of file diff --git a/page_templates/person.md.j2 b/page_templates/person.md.j2 index 8f6629e..4401e78 100644 --- a/page_templates/person.md.j2 +++ b/page_templates/person.md.j2 @@ -2,17 +2,12 @@ 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 }} --- - -{{ 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 -%}