blob: 6de4feb854f2fdd2b4de5d3d8c5904fb315cc619 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
{{- /* First, check for current page author(s) */}}
{{- if .Params.author }}
{{- $author_type := (printf "%T" .Params.author) }}
{{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }}
{{- (delimit .Params.author ", " ) }}
{{- else }}
{{- .Params.author }}
{{- end }}
{{- /* Otherwise, get site authors */}}
{{- else }}
{{- if site.Author }}
{{- $author_type := (printf "%T" site.Author) }}
{{- if (or (eq $author_type "map[string]string") (eq $author_type "map[string]interface {}")) }}
{{- range $i, $author := site.Author }}
{{- $name_type := (printf "%T" $author) }}
{{- if (eq $name_type "maps.Params") }}
{{- with $author.name }}{{ $.Scratch.SetInMap "names" . . }}{{ end }}
{{- else }}
{{- $.Scratch.SetInMap "names" site.Author.name site.Author.name }}
{{- break -}}
{{- end }}
{{- end }}
{{- delimit ($.Scratch.GetSortedMapValues "names") ", " }}
{{- end }}
{{- end -}}
{{- end -}}
|