From 0bde219bfe062ee6018196c385b42613489862dc Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 15 May 2022 14:00:11 +0200 Subject: Update author partial --- layouts/partials/author.html | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/author.html b/layouts/partials/author.html index efb1dbd..ccad7e7 100644 --- a/layouts/partials/author.html +++ b/layouts/partials/author.html @@ -6,23 +6,19 @@ {{- 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 }} +{{- 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 }} + {{- if (eq (printf "%T" $author) "maps.Params") }} + {{- with $author.name }}{{ $.Scratch.SetInMap "names" . . }}{{ end }} + {{- else }} + {{- $.Scratch.SetInMap "names" site.Author.name site.Author.name }} + {{- break -}} {{- end }} - {{- delimit ($.Scratch.GetSortedMapValues "names") ", " }} - {{- $.Scratch.Delete "names" -}} {{- end }} - {{- end -}} + {{- delimit ($.Scratch.GetSortedMapValues "names") ", " }} + {{- $.Scratch.Delete "names" -}} + {{- end }} {{- end -}} -- cgit v1.2.3