From: Danilo M. Date: Thu, 16 Apr 2026 10:54:14 +0000 (+0200) Subject: feat: i18n singular/plural post count on taxonomy list X-Git-Tag: release_22042026-1342~202 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=refs%2Fheads%2Ffix%2Ftaxonomy-layouts;p=danix.xyz-2.git feat: i18n singular/plural post count on taxonomy list Replace hardcoded "Posts: N" with i18n "postCount" key using Hugo's pluralization support (one/other forms). Renders "1 post" or "N posts" in English, "1 articolo" or "N articoli" in Italian. Co-Authored-By: Claude Haiku 4.5 --- diff --git a/i18n/en.yaml b/i18n/en.yaml index 2a90f2b..64b0a26 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -26,6 +26,9 @@ tag: "Tag" tags: "Tags" relatedPosts: "Related articles" noRelated: "No related articles." +postCount: + one: "1 post" + other: "{{ . }} posts" # Article types life: "Life" diff --git a/i18n/it.yaml b/i18n/it.yaml index 9fd729e..6bc291f 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -26,6 +26,9 @@ tag: "Tag" tags: "Tag" relatedPosts: "Articoli correlati" noRelated: "Nessun articolo correlato." +postCount: + one: "1 articolo" + other: "{{ . }} articoli" # Article types life: "Vita" diff --git a/themes/danix-xyz-hacker/layouts/taxonomy/list.html b/themes/danix-xyz-hacker/layouts/taxonomy/list.html index b3ab612..cd4945a 100644 --- a/themes/danix-xyz-hacker/layouts/taxonomy/list.html +++ b/themes/danix-xyz-hacker/layouts/taxonomy/list.html @@ -23,7 +23,7 @@
{{ partial "article-list-item.html" . }} - {{ .Pages.Len }} + {{ i18n "postCount" .Pages.Len }}
{{ end }} @@ -33,7 +33,7 @@
{{ partial "article-list-item.html" . }} - {{ .Pages.Len }} + {{ i18n "postCount" .Pages.Len }}
{{ end }}