From 183aeff1ed0c6f240048b3a8a0df692dd3559c3f Mon Sep 17 00:00:00 2001 From: pomeloy <45542782+pomeloy@users.noreply.github.com> Date: Fri, 19 Jan 2024 16:21:21 +0100 Subject: [PATCH] Do not render article-meta figure if there is nothing to display --- layouts/_default/single.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2a4935d4..c141f799 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -10,9 +10,17 @@

{{ .Title | emojify }}

-
- {{ partial "article-meta.html" (dict "context" . "scope" "single") }} -
+ {{ if or + (.Params.showDate | default (.Site.Params.article.showDate | default true)) + (and (.Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false)) (ne (partial "functions/date.html" .Date) (partial "functions/date.html" .Lastmod))) + (and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0)) + (and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0)) + (.Params.showEdit | default (.Site.Params.article.showEdit | default false)) + }} +
+ {{ partial "article-meta.html" (dict "context" . "scope" "single") }} +
+ {{ end }} ß {{ with $feature }}