From b0226b86e485be2a8f8ee37a0a7678017ea49c79 Mon Sep 17 00:00:00 2001 From: night0721 Date: Tue, 7 Nov 2023 23:26:52 +0000 Subject: [PATCH] Fix reading time appear on all files --- layouts/partials/single-header.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/layouts/partials/single-header.html b/layouts/partials/single-header.html index 1f5c6b3..09744f6 100644 --- a/layouts/partials/single-header.html +++ b/layouts/partials/single-header.html @@ -1,11 +1,14 @@ -{{ $image := (.Resources.ByType "image").GetMatch "images/*featured*" }} -

{{ .Title }}

{{ .Description | markdownify }}

{{ if and ( .Lastmod ) ( ne .Lastmod .PublishDate) }} {{ end }} + + +{{ if and (in (printf "/%s/" .File.Dir) "/posts/") (ne .File.BaseFileName "_index") }} {{ printf "Estimated reading time: %d minutes" .ReadingTime }} +{{ end }} +