summaryrefslogtreecommitdiff
path: root/layouts/list.html
diff options
context:
space:
mode:
authorArne Rief <riearn@proton.me>2026-01-09 12:24:05 +0100
committerArne Rief <riearn@proton.me>2026-01-09 12:24:05 +0100
commitf8541ef965ca22e746b523eb418e47cb4f78f2d8 (patch)
tree49e1540ed42595a44196817eadf97337587a2aea /layouts/list.html
parent038054b8206a9c25e84adeb0f0f355abd22d6143 (diff)
Upgrade to new template system from Hugo v0.146.0
Diffstat (limited to 'layouts/list.html')
-rw-r--r--layouts/list.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/layouts/list.html b/layouts/list.html
new file mode 100644
index 0000000..f952e56
--- /dev/null
+++ b/layouts/list.html
@@ -0,0 +1,39 @@
+{{- define "main" }}
+<section class="list-page">
+ <header class="list-page__header">
+ <h1 class="list-page__headline">
+ {{ .Title }}
+ </h1>
+ {{- with .Content }}
+ <div class="list-page__description">
+ {{ . }}
+ </div>
+ {{- else }}
+ {{- $description := or .Description .Summary (lang.Translate "list_description" .Title | default (printf "All posts in %s" .Title)) }}
+ <p class="list-page__description">
+ {{ $description }}
+ </p>
+ {{- end }}
+ </header>
+
+ <section class="list-page__content" aria-label="{{ lang.Translate "posts" | default "Posts" }}">
+ {{- /* 15 posts per site */ -}}
+ {{- $paginator := .Paginate .Pages 15 }}
+ {{- with $paginator.Pages }}
+ <ul class="list-page__posts-list">
+ {{- range . }}
+ <li class="list-page__post">
+ {{- partial "list/post-card.html" (dict "post" .) }}
+ </li>
+ {{- end }}
+ </ul>
+ {{ else }}
+ <p class="list-page__empty-message">
+ {{ lang.Translate "list_empty" | default "No posts found in this section." }}
+ </p>
+ {{- end }}
+ </section>
+
+ {{- partial "list/pagination.html" $paginator }}
+</section>
+{{- end }}