diff --git a/layouts/archive/list.html b/layouts/archive/list.html index 6ccd50f..746422c 100644 --- a/layouts/archive/list.html +++ b/layouts/archive/list.html @@ -49,4 +49,4 @@ {{ partial "script/archive-script" . }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/partials/body/infos.html b/layouts/partials/body/infos.html index 632e50c..0f82f2d 100644 --- a/layouts/partials/body/infos.html +++ b/layouts/partials/body/infos.html @@ -6,7 +6,7 @@ {{ end }}  ·  {{ ($.Site.Params.readingTimeIcon | safeHTML) | default "☕" }} {{ .ReadingTime }} {{ i18n "reading-time" }} {{ with .Params.Author }} -  ·  {{if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }} {{ . }} +  ·  {{if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }} {{ partial "head/author.html" . }} {{ end }} {{ if (and .Site.Params.enableBusuanzi .Site.Params.busuanziPagePV) }} · {{ ($.Site.Params.pagePvIcon | safeHTML) | default "👀" }}... {{ i18n "counter-page-pv" }}{{ end }} diff --git a/layouts/partials/body/whoami.html b/layouts/partials/body/whoami.html index 2428dcd..28c8595 100644 --- a/layouts/partials/body/whoami.html +++ b/layouts/partials/body/whoami.html @@ -27,7 +27,7 @@
{{ if $.Param "author" }} - {{ $.Param "author" }} + {{ partial "head/author.html" ($.Param "author") }} {{ else }} {{ $.Param "myname" }} {{ end }} diff --git a/layouts/partials/head/author.html b/layouts/partials/head/author.html new file mode 100644 index 0000000..5a71b59 --- /dev/null +++ b/layouts/partials/head/author.html @@ -0,0 +1,7 @@ +{{ $author_type := (printf "%T" .) }} +{{ $author_is_slice := (eq "[]string" $author_type) }} + {{ if $author_is_slice }} + {{ delimit . ", " }} + {{ else }} + {{ . }} + {{ end }} diff --git a/layouts/partials/summary/card.html b/layouts/partials/summary/card.html index ed8187d..cd9309e 100644 --- a/layouts/partials/summary/card.html +++ b/layouts/partials/summary/card.html @@ -8,7 +8,7 @@ {{ end }} · {{ ($.Site.Params.readingTimeIcon | safeHTML) | default "☕" }} {{ .ReadingTime }} {{ i18n "reading-time" }} {{ with $.Param "author" }} - · {{ if $.Param "AuthorEmoji" }}{{ $.Param "AuthorEmoji" }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }} {{ . }} + · {{ if $.Param "AuthorEmoji" }}{{ $.Param "AuthorEmoji" }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }} {{ partial "head/author.html" . }} {{ end }} diff --git a/layouts/partials/summary/classic.html b/layouts/partials/summary/classic.html index db71419..9946799 100644 --- a/layouts/partials/summary/classic.html +++ b/layouts/partials/summary/classic.html @@ -25,7 +25,7 @@ {{ end }} · {{ ($.Site.Params.readingTimeIcon | safeHTML) | default "☕" }} {{ .ReadingTime }} {{ i18n "reading-time" }} {{ with $.Param "author" }} - · {{ if $.Param "authorEmoji" }}{{ $.Param "authorEmoji" }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }} {{ . }} + · {{ if $.Param "authorEmoji" }}{{ $.Param "authorEmoji" }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }} {{ partial "head/author.html" . }} {{ end }} diff --git a/layouts/partials/summary/compact.html b/layouts/partials/summary/compact.html index a9df179..6e675f7 100644 --- a/layouts/partials/summary/compact.html +++ b/layouts/partials/summary/compact.html @@ -11,7 +11,7 @@ {{ end }} · {{ ($.Site.Params.readingTimeIcon | safeHTML) | default "☕" }} {{ .ReadingTime }} {{ i18n "reading-time" }} {{ with $params.Author }} - · {{ if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }} {{ . }} + · {{ if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }} {{ partial "head/author.html" . }} {{ end }}