diff options
Diffstat (limited to 'themes/danix-xyz-hacker/layouts/_default/list.html')
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/_default/list.html | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/themes/danix-xyz-hacker/layouts/_default/list.html b/themes/danix-xyz-hacker/layouts/_default/list.html index 357b856..7d8c263 100644 --- a/themes/danix-xyz-hacker/layouts/_default/list.html +++ b/themes/danix-xyz-hacker/layouts/_default/list.html @@ -10,6 +10,14 @@ {{ $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" . }} |
