From a0bd0073bb34427ae6e90b3a708e881bfde11d6d Mon Sep 17 00:00:00 2001 From: Andrew Doering Date: Wed, 4 Mar 2026 11:58:09 +0100 Subject: [PATCH] fix: reading time not displaying in `article/components/details` partial (#1278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix reading time not displaying due to .Site context in dict partial The details.html partial receives a dict context via: partial "article/components/details" (dict "Page" $Page "IsList" $IsList) When the dot context is a dict, .Site resolves to nil, so .Site.Params.article.readingTime always returns empty/false, causing the reading time to never display. Lines 40 and 67 of the same file already correctly use $Page.Site.Params — this fixes line 31 to be consistent. Co-authored-by: delize <4028612+delize@users.noreply.github.com> --- layouts/_partials/article/components/details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_partials/article/components/details.html b/layouts/_partials/article/components/details.html index 1c87680..1482cb1 100644 --- a/layouts/_partials/article/components/details.html +++ b/layouts/_partials/article/components/details.html @@ -28,7 +28,7 @@ {{ end }} - {{ $showReadingTime := $Page.Params.readingTime | default (.Site.Params.article.readingTime) }} + {{ $showReadingTime := $Page.Params.readingTime | default ($Page.Site.Params.article.readingTime) }} {{ $showDate := not $Page.Date.IsZero }} {{ $showFooter := or $showDate $showReadingTime }} {{ if $showFooter }}