From 60a0feb39d3ec975472f12377db9182789776c10 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Mon, 16 May 2022 02:13:01 +0200 Subject: Simplified setting the author --- layouts/partials/author.html | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'layouts/partials/author.html') diff --git a/layouts/partials/author.html b/layouts/partials/author.html index ccad7e7..2bfddb3 100644 --- a/layouts/partials/author.html +++ b/layouts/partials/author.html @@ -7,18 +7,6 @@ {{- .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 }} - {{- 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 }} - {{- end }} - {{- delimit ($.Scratch.GetSortedMapValues "names") ", " }} - {{- $.Scratch.Delete "names" -}} - {{- end }} +{{- else if site.Author.name }} + {{- site.Author.name }} {{- end -}} -- cgit v1.2.3