Fixed plural-singular issue with reading time indications

This commit is contained in:
2025-04-05 23:15:34 +02:00
parent 77fe18522e
commit 0fbd45a05d
5 changed files with 38 additions and 12 deletions

View File

@@ -16,7 +16,7 @@
<span class="post-author">{{ . }}</span>
{{- end -}}
{{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}}
<span class="post-reading-time">{{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }} ({{ .WordCount }} {{ $.Site.Params.words | default "words" }})</span>
<span class="post-reading-time">{{ .ReadingTime }} {{ if eq .ReadingTime 1 }}{{ $.Site.Params._minute | default "minute" }}{{ else }}{{ $.Site.Params._minutes | default "minutes" }}{{ end }} {{$.Site.Params._readingTime | default "to read" }} ({{ .WordCount }} {{ if eq .WordCount 1 }}{{ $.Site.Params._word | default "word" }}{{ else }}{{ $.Site.Params._words | default "words" }}{{ end }})</span>
{{- end -}}
<!-- comments counter -->{{ partial "comments_counter.html" . }}
</div>