Files
site/themes/minimo/layouts/partials/data/author/displayName
2021-09-06 13:02:12 -04:00

16 lines
546 B
Plaintext

{{- $.Scratch.Set "authorID" "" -}}
{{- if eq .Kind "term" -}}
{{- $.Scratch.Set "authorID" .Data.Term -}}
{{- else if eq .Kind "taxonomy" -}}
{{- $.Scratch.Set "authorID" .Name -}}
{{- else if eq .Kind "page" -}}
{{- $.Scratch.Set "authorID" ( index .Params.authors 0 ) -}}
{{- end -}}
{{- $lang := ( .Params.lang | default .Lang ) -}}
{{- $author := ( index $.Site.Data.authors ( $.Scratch.Get "authorID" ) ) -}}
{{- $i18nAuthor := ( index $author $lang ) -}}
{{- $name := ( or $i18nAuthor.name $author.name ) -}}
{{- $name.display -}}