From cff88c00f55e28312883373a29620ff8256a643d Mon Sep 17 00:00:00 2001 From: Chris Herborth Date: Sun, 16 Aug 2026 17:32:09 -0400 Subject: [PATCH] Address #3033 - suppress default author when using multi-author (#3034) Co-authored-by: Chris Herborth --- layouts/_default/single.html | 44 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c2fc57e1..50b932f9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -116,29 +116,31 @@ {{ $baseURL = delimit (slice $baseURL "/") "" }} {{ end }} - {{ if .Params.showAuthor | default (site.Params.article.showAuthor | default true) }} - {{ $showAuthor = 1 }} - {{ partial "author.html" . }} - {{ end }} - - {{ range $author := .Page.Params.authors }} - {{ $authorData := index $authorsData $author }} - {{- if $authorData -}} - {{ range $taxonomyname, $taxonomy := $taxonomies }} - {{ if (eq $taxonomyname $author) }} - {{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }} + {{ if .Page.Params.authors }} + {{ range $author := .Page.Params.authors }} + {{ $authorData := index $authorsData $author }} + {{- if $authorData -}} + {{ range $taxonomyname, $taxonomy := $taxonomies }} + {{ if (eq $taxonomyname $author) }} + {{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }} + {{ end }} {{ end }} - {{ end }} - {{ $finalLink := $taxonomyLink }} - {{ $currentLang := site.Language.Name }} - {{ if eq site.LanguagePrefix "" }} - {{ $finalLink = printf "%sauthors/%s/" $baseURL $author }} - {{ else }} - {{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }} - {{ end }} - {{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }} - {{- end -}} + {{ $finalLink := $taxonomyLink }} + {{ $currentLang := site.Language.Name }} + {{ if eq site.LanguagePrefix "" }} + {{ $finalLink = printf "%sauthors/%s/" $baseURL $author }} + {{ else }} + {{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }} + {{ end }} + {{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }} + {{- end -}} + {{ end }} + {{ else }} + {{ if .Params.showAuthor | default (site.Params.article.showAuthor | default true) }} + {{ $showAuthor = 1 }} + {{ partial "author.html" . }} + {{ end }} {{ end }} {{ if or $taxonomyLink $showAuthor }}