summaryrefslogtreecommitdiff
path: root/layouts/_default/list.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default/list.html')
-rw-r--r--layouts/_default/list.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index e69de29..8ff9b18 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -0,0 +1,33 @@
+{{- define "main" }}
+<section class="section-list">
+ <header class="section-list__header">
+ <h1 class="section-list__headline">
+ {{ .Title }}
+ </h1>
+ {{- $description := or .Description .Summary (lang.Translate "list.default_description" .Title | default (printf "All posts in %s" .Title)) }}
+ <p class="section-list__description">
+ {{ $description }}
+ </p>
+ </header>
+
+ <section class="section-list__content" aria-label="{{ lang.Translate "posts.name" | default "Posts" }}">
+ {{- /* 20 posts per site */ -}}
+ {{- $paginator := .Paginate .Pages 20 }}
+ {{- with $paginator.Pages }}
+ <ul class="section-list__posts">
+ {{- range . }}
+ <li class="section-list__post">
+ {{- partial "list/post-card.html" . }}
+ </li>
+ {{- end }}
+ </ul>
+ {{- else }}
+ <p class="section-list__empty-message">
+ {{ lang.Translate "list.empty" | default "No posts found in this section." }}
+ </p>
+ {{- end }}
+ </section>
+
+ {{- partial "list/pagination.html" $paginator }}
+</section>
+{{- end }}