From a1e9b05dccd9126c26c91e89ec5550f215f90814 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Wed, 6 Nov 2024 15:27:51 +0100 Subject: [PATCH] Fix bug in author params code, reported in issue #117. --- layouts/partials/author-date.html | 4 ++-- layouts/partials/meta.html | 2 +- layouts/partials/meta_json_ld.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/partials/author-date.html b/layouts/partials/author-date.html index 8122cdd..40e998a 100644 --- a/layouts/partials/author-date.html +++ b/layouts/partials/author-date.html @@ -1,3 +1,3 @@ -{{ with $.Param "author" | default site.Params.author.name }}{{ end -}} -{{ if and .Date (or ($.Param "author") site.Params.author.name) }} - {{ end -}} +{{ with .Params.author | default site.Params.author.name }}{{ end -}} +{{ if and .Date (or .Params.author site.Params.author.name) }} - {{ end -}} {{ with .Date }}{{ end }} diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 459a29b..634031a 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -5,7 +5,7 @@ -{{ with $.Param "author" }}{{ end }} +{{ with .Params.author | default site.Params.author.name }}{{ end }} {{ with $.Param "contact" }}{{ end }} diff --git a/layouts/partials/meta_json_ld.html b/layouts/partials/meta_json_ld.html index 156004f..87d0850 100644 --- a/layouts/partials/meta_json_ld.html +++ b/layouts/partials/meta_json_ld.html @@ -33,7 +33,7 @@ {{ with $.Param "image" -}} "image" : {{ . | absURL }}, {{ end -}} - {{ with $.Param "author" -}} + {{ with .Params.author | default site.Params.author.name -}} "author": { "@type": "Person", "name": {{ . }}