]> danix's work - danix.xyz-2.git/commitdiff
feat: i18n singular/plural post count on taxonomy list fix/taxonomy-layouts
authorDanilo M. <redacted>
Thu, 16 Apr 2026 10:54:14 +0000 (12:54 +0200)
committerDanilo M. <redacted>
Thu, 16 Apr 2026 10:54:14 +0000 (12:54 +0200)
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 <redacted>
i18n/en.yaml
i18n/it.yaml
themes/danix-xyz-hacker/layouts/taxonomy/list.html

index 2a90f2b9ebef0d789600aac3e0606c0411394647..64b0a267c319d29214446a9ab0b72104e66a3ec0 100644 (file)
@@ -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"
index 9fd729e12068265daa28dfbdf489bf41a0afc572..6bc291f44be2c92bb03b789871bcc78f191fe61f 100644 (file)
@@ -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"
index b3ab6124e1cd6ca56ef7c63e3db70f44647757b5..cd4945a00de4d45221d36b47b05c7e33ad4bc7e0 100644 (file)
@@ -23,7 +23,7 @@
       <div class="relative">
         {{ partial "article-list-item.html" . }}
         <span class="absolute top-4 right-4 px-2 py-0.5 rounded text-xs font-mono bg-surface text-text-dim border border-border/30">
-          {{ .Pages.Len }}
+          {{ i18n "postCount" .Pages.Len }}
         </span>
       </div>
     {{ end }}
@@ -33,7 +33,7 @@
       <div class="relative">
         {{ partial "article-list-item.html" . }}
         <span class="absolute top-4 right-4 px-2 py-0.5 rounded text-xs font-mono bg-surface text-text-dim border border-border/30">
-          {{ .Pages.Len }}
+          {{ i18n "postCount" .Pages.Len }}
         </span>
       </div>
     {{ end }}