fix: reading time not displaying in article/components/details partial (#1278)
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>
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ $showReadingTime := $Page.Params.readingTime | default (.Site.Params.article.readingTime) }}
|
{{ $showReadingTime := $Page.Params.readingTime | default ($Page.Site.Params.article.readingTime) }}
|
||||||
{{ $showDate := not $Page.Date.IsZero }}
|
{{ $showDate := not $Page.Date.IsZero }}
|
||||||
{{ $showFooter := or $showDate $showReadingTime }}
|
{{ $showFooter := or $showDate $showReadingTime }}
|
||||||
{{ if $showFooter }}
|
{{ if $showFooter }}
|
||||||
|
|||||||
Reference in New Issue
Block a user