From 55106c1ff641243b068f3fb4e34d5ea6d4d53232 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Wed, 11 Sep 2019 13:27:11 +0100 Subject: [PATCH] refactor: page author link based on site_type in params.toml --- layouts/partials/page_author.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/partials/page_author.html b/layouts/partials/page_author.html index d591ce3c..309ba01f 100644 --- a/layouts/partials/page_author.html +++ b/layouts/partials/page_author.html @@ -16,12 +16,13 @@ {{ $author_urlized = urlize $first_author }} {{ end }} +{{ $site_type := site.Params.site_type | default "Person" }} {{ $taxonomy := "authors" }} {{ $profile_page := site.GetPage (printf "/%s/%s" $taxonomy $author_urlized) }} {{ with $profile_page }} {{/* 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 (not site.Data.organization.name) (eq .Params.superuser true) }} + {{ if and (eq $site_type "Person") (eq .Params.superuser true) }} {{ $profile_url = site.BaseURL }} {{ end }} {{ $avatar := (.Resources.ByType "image").GetMatch "*avatar*" }}