summaryrefslogtreecommitdiffstats
path: root/layouts/_default/list.html
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-22 12:42:56 +0200
committerDanilo M. <danix@danix.xyz>2026-04-22 12:42:56 +0200
commit631547a75142326a7c71bdf123e1475217a5ad73 (patch)
treef3cfef6b3c5b42bf626fc823ddcf63b8dcf4cdbb /layouts/_default/list.html
parent77ccbe72fad5a4870185fff374f75471c16a9043 (diff)
downloaddanixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.tar.gz
danixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.zip
chore: replace with extracted danix.xyz-hacker theme (danix2-hugo-theme)
Diffstat (limited to 'layouts/_default/list.html')
-rw-r--r--layouts/_default/list.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100644
index 0000000..09c0cbb
--- /dev/null
+++ b/layouts/_default/list.html
@@ -0,0 +1,39 @@
+{{ define "main" }}
+<div class="mx-auto px-4 py-12 max-w-5xl">
+ <h1 class="text-4xl md:text-5xl font-bold text-accent mb-12">
+ {{ .Title }}
+ </h1>
+
+ {{ $pinned := where .Pages "Params.pinned" true }}
+ {{ $unpinned := where .Pages "Params.pinned" false }}
+ {{ if eq (len $unpinned) 0 }}
+ {{ $unpinned = where .Pages "Params.pinned" nil }}
+ {{ if eq (len $unpinned) 0 }}
+ {{ $unpinned = where .Pages "Params.pinned" "" }}
+ {{ end }}
+ {{ end }}
+
+ {{ $allPages := ($pinned | append $unpinned) }}
+
+ {{ if eq (len $allPages) 0 }}
+ <div class="py-12 text-center text-text-dim">
+ {{ i18n "noRelated" }}
+ </div>
+ {{ else }}
+ <ol class="timeline" aria-label="{{ .Title }}">
+ {{ range $i, $page := (sort $pinned "Date" "desc") }}
+ {{ $side := "left" }}
+ {{ if eq (mod $i 2) 0 }}{{ $side = "left" }}{{ else }}{{ $side = "right" }}{{ end }}
+ {{ partial "article-list-item.html" (dict "Page" $page "side" $side) }}
+ {{ end }}
+ {{ $offset := len $pinned }}
+ {{ range $i, $page := (sort $unpinned "Date" "desc") }}
+ {{ $idx := add $i $offset }}
+ {{ $side := "left" }}
+ {{ if eq (mod $idx 2) 0 }}{{ $side = "left" }}{{ else }}{{ $side = "right" }}{{ end }}
+ {{ partial "article-list-item.html" (dict "Page" $page "side" $side) }}
+ {{ end }}
+ </ol>
+ {{ end }}
+</div>
+{{ end }}