This adds a custom JSON rendering for contributor pages. Properties are explicitly selected from the .Params in line with the html template.
16 lines
601 B
JSON
16 lines
601 B
JSON
{{- /* collect permalinks to term-related pages */ -}}
|
|
{{- $relatedPermalinks := slice -}}
|
|
{{- range .Pages -}}
|
|
{{- $relatedPermalinks = $relatedPermalinks | append .Permalink -}}
|
|
{{- end -}}
|
|
{{/* make a selection of params and other properties */}}
|
|
{{- $selected := dict
|
|
"permalink" .Permalink
|
|
"related" $relatedPermalinks
|
|
"content" (.Plain | emojify )
|
|
"orcid" (.Param "orcid")
|
|
"affiliation" (.Param "affiliation")
|
|
"see_also" (dict (.Param "seealso-text" | default "Homepage" ) (.Param "seealso-link"))
|
|
-}}
|
|
{{/* merge those things with params, serve that */}}
|
|
{{ $selected | jsonify }}
|