Fixed plural-singular issue with reading time indications

This commit is contained in:
BlueFox 2025-04-05 23:15:34 +02:00
parent 77fe18522e
commit 0fbd45a05d
Signed by: BlueFox
GPG Key ID: 327233DA85435270
5 changed files with 38 additions and 12 deletions

View File

@ -0,0 +1,8 @@
+++
title = 'Deutscher Test Post'
date = 2025-04-05T20:14:29+02:00
draft = false
toc = false
+++
# Nureinwort

View File

@ -0,0 +1,8 @@
+++
title = 'English Test Post'
date = 2025-04-05T22:48:12+02:00
draft = false
toc = false
+++
# Justoneword

View File

@ -83,7 +83,7 @@ pagination.pagerSize = 5
subtitle = "Blog of privacynerd" subtitle = "Blog of privacynerd"
owner = "" owner = ""
keywords = "" keywords = ""
copyright = "© 2025 Benjamin Burkhardt" copyright = "Benjamin Burkhardt"
menuMore = "Show more" menuMore = "Show more"
readMore = "Read more" readMore = "Read more"
readOtherPosts = "Read other posts" readOtherPosts = "Read other posts"
@ -91,9 +91,14 @@ pagination.pagerSize = 5
olderPosts = "Older posts" olderPosts = "Older posts"
missingContentMessage = "Page not found..." missingContentMessage = "Page not found..."
missingBackButtonLabel = "Back to home page" missingBackButtonLabel = "Back to home page"
minuteReadingTime = "min read" _minute = "minute"
words = "words" _minutes = "minutes"
imprint = "Imprint" _readingTime = "to read"
_word = "word"
_words = "words"
_imprint = "Imprint"
_by = "by"
_customized = "customized"
[languages.en.params.logo] [languages.en.params.logo]
logoText = "Privacynerd's blog" logoText = "Privacynerd's blog"
@ -120,7 +125,7 @@ pagination.pagerSize = 5
subtitle = "Blog von privacynerd" subtitle = "Blog von privacynerd"
owner = "" owner = ""
keywords = "" keywords = ""
copyright = "© 2025 Benjamin Burkhardt" copyright = "Benjamin Burkhardt"
menuMore = "Mehr zeigen" menuMore = "Mehr zeigen"
readMore = "Mehr lesen" readMore = "Mehr lesen"
readOtherPosts = "Andere Posts lesen" readOtherPosts = "Andere Posts lesen"
@ -128,9 +133,14 @@ pagination.pagerSize = 5
olderPosts = "Ältere Posts" olderPosts = "Ältere Posts"
missingContentMessage = "Seite konnte nicht gefunden werden..." missingContentMessage = "Seite konnte nicht gefunden werden..."
missingBackButtonLabel = "Zurück zur Startseite" missingBackButtonLabel = "Zurück zur Startseite"
minuteReadingTime = "Minuten Lesezeit" _minute = "Minute"
words = "Wörter" _minutes = "Minuten"
imprint = "Impressum" _readingTime = "Lesezeit"
_word = "Wort"
_words = "Wörter"
_imprint = "Impressum"
_by = "von"
_customized = "angepasst"
[languages.de.params.logo] [languages.de.params.logo]
logoText = "Privacynerd's blog" logoText = "Privacynerd's blog"

View File

@ -16,7 +16,7 @@
<span class="post-author">{{ . }}</span> <span class="post-author">{{ . }}</span>
{{- end -}} {{- end -}}
{{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}} {{- 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 -}} {{- end -}}
<!-- comments counter -->{{ partial "comments_counter.html" . }} <!-- comments counter -->{{ partial "comments_counter.html" . }}
</div> </div>

View File

@ -2,13 +2,13 @@
<div class="footer__inner"> <div class="footer__inner">
{{ if $.Site.Params.Copyright }} {{ if $.Site.Params.Copyright }}
<div class="copyright copyright--user"> <div class="copyright copyright--user">
<span>{{ $.Site.Params.Copyright | safeHTML }}</span> <span>© {{ now.Year }} {{ $.Site.Params.Copyright | safeHTML }}</span>
{{ else }} {{ else }}
<div class="copyright"> <div class="copyright">
<span>© {{ now.Year }} Powered by <a href="https://gohugo.io">Hugo</a></span> <span>© {{ now.Year }} Powered by <a href="https://gohugo.io">Hugo</a></span>
{{ end }} {{ end }}
<span style="margin-right: 10px">:: <a href="https://privacynerd.de/impressum?referrer={{ $.Site.BaseURL }}" target="_blank">{{ $.Site.Params.Imprint }}</a></span> <span style="margin-right: 10px">:: <a href="https://privacynerd.de/impressum?referrer={{ $.Site.BaseURL }}" target="_blank">{{ $.Site.Params._Imprint }}</a></span>
<span>:: <a href="https://github.com/mirus-ua/hugo-theme-re-terminal" target="_blank">Theme</a> by <a href="https://github.com/mirus-ua" target="_blank">Mirus</a> (customized)</span> <span>:: <a href="https://github.com/mirus-ua/hugo-theme-re-terminal" target="_blank">Theme</a> {{ $.Site.Params._By }} <a href="https://github.com/mirus-ua" target="_blank">Mirus</a> ({{ $.Site.Params._Customized }})</span>
</div> </div>
</div> </div>
</footer> </footer>