From 5c37a130020285e4f3782926761b702afe1f0123 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 14 Nov 2026 05:02:46 -0700 Subject: [PATCH] single, fix word count and read time, while also making it respect the params in config file. --- layouts/posts/single.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/layouts/posts/single.html b/layouts/posts/single.html index fb56a86..523e020 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -3,11 +3,13 @@

+ {{- if (.Param "ShowReadingTime") -}} - {{ i18n "readingTime" .Page.ReadingTime }} + {{ printf "%s" (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime)) }} + {{- end -}} {{ if .IsTranslated }} | {{ i18n "postAvailable" }} {{ range .Translations }} @@ -83,12 +85,14 @@ {{ partial "series.html" . }} {{ partial "categories.html" . }} + {{- if (.Param "ShowWordCount") -}}

Word Count: - {{ i18n "wordCount" .Page.WordCount }} + {{ printf "%s" (i18n "words" .WordCount | default (printf "%d words" .WordCount)) }}

+ {{- end -}} {{ if .Params.Started }}