diff --git a/wowchemy/layouts/partials/page_author.html b/wowchemy/layouts/partials/page_author.html index 56fbea9e..74fa41c0 100644 --- a/wowchemy/layouts/partials/page_author.html +++ b/wowchemy/layouts/partials/page_author.html @@ -6,14 +6,13 @@ {{/* Display superuser if superuser exists and page authors are not explicitly specified. */}} {{/* Otherwise, display first author if a profile for them exists. */}} -{{ $author_urlized := "" }} {{ if and (not .Params.authors) (.Scratch.Get "superuser_username") }} - {{ $author_urlized = (.Scratch.Get "superuser_username") }} - {{ partial "page_author_card" (dict "username" $author_urlized) }} + {{ $author_page := site.GetPage (printf "/%s/%s" "authors" (.Scratch.Get "superuser_username")) }} + {{ partial "page_author_card" (dict "author_page" $author_page) }} {{ else if .Params.authors }} - {{ range $key, $tmp_username := .Params.authors }} - {{ $author_urlized = urlize $tmp_username }} - {{ partial "page_author_card" (dict "username" $author_urlized) }} + {{ $taxonomy := "authors" }} + {{ range $author_obj := (.GetTerms $taxonomy) }} + {{ partial "page_author_card" (dict "author_page" $author_obj.Page) }} {{ end }} {{ end }} diff --git a/wowchemy/layouts/partials/page_author_card.html b/wowchemy/layouts/partials/page_author_card.html index dffdc5d2..6bc06e9d 100644 --- a/wowchemy/layouts/partials/page_author_card.html +++ b/wowchemy/layouts/partials/page_author_card.html @@ -1,31 +1,30 @@ {{ $page := .page }} -{{ $author_urlized := .username }} +{{ $author_page := .author_page }} {{ $site_type := site.Params.site_type | default "Person" }} -{{ $taxonomy := "authors" }} -{{ $profile_page := site.GetPage (printf "/%s/%s" $taxonomy $author_urlized) }} -{{ with $profile_page }} - {{ if isset .Params "superuser" }}{{/* Check an author profile exists. */}} - {{/* If it's a personal site and primary page author is superuser, link to the homepage rather than their profile page. */}} - {{ $profile_url := .RelPermalink }} - {{ if and (eq $site_type "Person") (eq .Params.superuser true) }} - {{ $profile_url = site.BaseURL }} - {{ end }} - {{ $avatar := (.Resources.ByType "image").GetMatch "*avatar*" }} - {{ $avatar_shape := site.Params.avatar.shape | default "circle" }} -