Files
HugoBlox-kit/layouts/partials/page_metadata_authors.html
T
George Cushen 0db000a841 feat: add options to add author notes + highlight superuser
To highlight the site author (superuser) in author lists, set the following in `params.toml`:

highlight_superuser = true

Author notes can be added to a page's front matter in the form:

author_notes:
- "Equal contribution"
- "Equal contribution"
2020-06-07 20:02:12 +01:00

24 lines
893 B
HTML

{{/* Display author list. */}}
{{- $taxonomy := "authors" }}
{{ with .Param $taxonomy }}
{{ $link_authors := site.Params.link_authors | default true }}
{{ range $index, $name_raw := . }}
{{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy .) -}}
{{- $name := $profile_page.Title | default $name_raw -}}
{{- if gt $index 0 }}, {{ end -}}
<span {{ if site.Params.highlight_superuser | and (eq $profile_page.Params.superuser true) }}class="font-weight-bold"{{end}}>
{{- if and $profile_page $link_authors -}}
<a href="{{$profile_page.RelPermalink}}">{{$name}}</a>
{{- else -}}
{{$name}}
{{- end -}}
</span>
{{- if isset $.Params "author_notes" -}}
{{- with (index $.Params.author_notes $index) -}}
<span title="{{.}}" class="author-notes">(?)</span>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}