From 9285958da995b99e7f4e076eb2a1628f9b274a43 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 e1a1f1f7..9caeeb65 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -10,9 +10,17 @@
-
- {{ 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 }}
{{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }}