From 9ac57313ffcea6f7159f775e886f0f29dc434274 Mon Sep 17 00:00:00 2001 From: alex bezek Date: Sat, 31 Oct 2020 11:30:23 -0400 Subject: [PATCH] Fix the get author name partial to account for localized author names (#141) --- layouts/partials/helpers/get-author-name.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/layouts/partials/helpers/get-author-name.html b/layouts/partials/helpers/get-author-name.html index 63c0846..d19c0cf 100644 --- a/layouts/partials/helpers/get-author-name.html +++ b/layouts/partials/helpers/get-author-name.html @@ -1,7 +1,12 @@ +{{/* Uses the top level site's config for a single author across all locales */}} {{ $authorName:= site.Params.author.name }} -{{ if site.Data.site.author}} - {{ $authorName = site.Data.site.author.name }} -{{ end}} + +{{/* Overrides with the locale specifc author if provided */}} +{{ if (index site.Data site.Language.Lang).author }} + {{ $authorName = (index site.Data site.Language.Lang).author.name }} +{{ end }} + +{{/* Lastly, overrides with the post specific author if provided */}} {{ if eq (printf "%T" .Params.author ) "maps.Params" }} {{ with .Params.author }} {{ if .name }}