From 5d34c3de440fefd846fc3f36de991cd284b890f5 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 29 Oct 2022 14:50:15 +0200 Subject: fix(article): frontmatter field `.ReadingTime` should overwrite global configuration (#710) --- layouts/partials/article/components/details.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html index cb85f1c..cc0a0fc 100644 --- a/layouts/partials/article/components/details.html +++ b/layouts/partials/article/components/details.html @@ -23,9 +23,12 @@ {{ end }} - {{ if or (not .Date.IsZero) (.Site.Params.article.readingTime) }} + {{ $showReadingTime := .Params.readingTime | default (.Site.Params.article.readingTime) }} + {{ $showDate := not .Date.IsZero }} + {{ $showFooter := or $showDate $showReadingTime }} + {{ if $showFooter }}