]> danix's work - danix.xyz-2.git/commitdiff
fix: restore articles to taxonomy pages and fix i18n headings
authorDanilo M. <redacted>
Thu, 16 Apr 2026 10:44:04 +0000 (12:44 +0200)
committerDanilo M. <redacted>
Thu, 16 Apr 2026 10:44:04 +0000 (12:44 +0200)
Fixed two critical bugs in taxonomy layouts:

1. Pinned/unpinned filter was silently hiding all articles. The filter
   only matched pages that explicitly set pinned=false, dropping all
   articles that omitted the parameter (most articles have nil, not false).
   Added the nil/empty fallback from _default/list.html.

2. Missing i18n keys caused blank headings on some taxonomy pages:
   - Added 'tag' key for /tags/term/ pages
   - Added 'categories' key for /categories/ list page

3. Harmonized spacing with main article list for visual consistency:
   Changed from space-y-2 max-w-2xl to space-y-6 max-w-3xl

Changes:
- i18n/en.yaml: Added 'tag' and 'categories' keys
- i18n/it.yaml: Added 'tag' and 'categories' keys
- taxonomy/list.html: Added nil fallback + spacing fix
- taxonomy/term.html: Added nil fallback + spacing fix

Co-Authored-By: Claude Haiku 4.5 <redacted>
i18n/en.yaml
i18n/it.yaml
themes/danix-xyz-hacker/layouts/taxonomy/list.html
themes/danix-xyz-hacker/layouts/taxonomy/term.html

index 2bcf5792b568654753f6c1f2713211897c658bb0..2a90f2b9ebef0d789600aac3e0606c0411394647 100644 (file)
@@ -21,6 +21,8 @@ readingTime: "reading time"
 min: "min"
 author: "Author"
 category: "Category"
+categories: "Categories"
+tag: "Tag"
 tags: "Tags"
 relatedPosts: "Related articles"
 noRelated: "No related articles."
index e22c0c50c3ae5b441162edf201e7ad813adb5c1b..9fd729e12068265daa28dfbdf489bf41a0afc572 100644 (file)
@@ -21,6 +21,8 @@ readingTime: "tempo di lettura"
 min: "min"
 author: "Autore"
 category: "Categoria"
+categories: "Categorie"
+tag: "Tag"
 tags: "Tag"
 relatedPosts: "Articoli correlati"
 noRelated: "Nessun articolo correlato."
index fd4b5d976e00336bd513548e89675b7644b625f5..b923aba9924d97d454bf864db60aba8d489836af 100644 (file)
@@ -6,10 +6,18 @@
   </h1>
 
   <!-- Articles list -->
-  <div class="space-y-2 max-w-2xl">
+  <div class="space-y-6 max-w-3xl">
     {{ $pinned := where .Pages "Params.pinned" true }}
     {{ $unpinned := where .Pages "Params.pinned" false }}
 
+    <!-- If no unpinned posts found (because param is undefined), get all non-pinned pages -->
+    {{ if eq (len $unpinned) 0 }}
+      {{ $unpinned = where .Pages "Params.pinned" nil }}
+      {{ if eq (len $unpinned) 0 }}
+        {{ $unpinned = where .Pages "Params.pinned" "" }}
+      {{ end }}
+    {{ end }}
+
     <!-- Pinned posts first -->
     {{ range (sort $pinned "Date" "desc") }}
       {{ partial "article-list-item.html" . }}
index 5353715374c8c7193c6211a923d422f406ca800c..5858f64cade18c974d53e6149f910e1ed337d494 100644 (file)
   </p>
 
   <!-- Articles list -->
-  <div class="space-y-2 max-w-2xl">
+  <div class="space-y-6 max-w-3xl">
     {{ $pinned := where .Pages "Params.pinned" true }}
     {{ $unpinned := where .Pages "Params.pinned" false }}
 
+    <!-- If no unpinned posts found (because param is undefined), get all non-pinned pages -->
+    {{ if eq (len $unpinned) 0 }}
+      {{ $unpinned = where .Pages "Params.pinned" nil }}
+      {{ if eq (len $unpinned) 0 }}
+        {{ $unpinned = where .Pages "Params.pinned" "" }}
+      {{ end }}
+    {{ end }}
+
     <!-- Pinned posts first -->
     {{ range (sort $pinned "Date" "desc") }}
       {{ partial "article-list-item.html" . }}