diff options
| -rw-r--r-- | i18n/en.yaml | 2 | ||||
| -rw-r--r-- | i18n/it.yaml | 2 | ||||
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/taxonomy/list.html | 10 | ||||
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/taxonomy/term.html | 10 |
4 files changed, 22 insertions, 2 deletions
diff --git a/i18n/en.yaml b/i18n/en.yaml index 2bcf579..2a90f2b 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -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." diff --git a/i18n/it.yaml b/i18n/it.yaml index e22c0c5..9fd729e 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -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." diff --git a/themes/danix-xyz-hacker/layouts/taxonomy/list.html b/themes/danix-xyz-hacker/layouts/taxonomy/list.html index fd4b5d9..b923aba 100644 --- a/themes/danix-xyz-hacker/layouts/taxonomy/list.html +++ b/themes/danix-xyz-hacker/layouts/taxonomy/list.html @@ -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" . }} diff --git a/themes/danix-xyz-hacker/layouts/taxonomy/term.html b/themes/danix-xyz-hacker/layouts/taxonomy/term.html index 5353715..5858f64 100644 --- a/themes/danix-xyz-hacker/layouts/taxonomy/term.html +++ b/themes/danix-xyz-hacker/layouts/taxonomy/term.html @@ -13,10 +13,18 @@ </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" . }} |
