diff options
Diffstat (limited to 'layouts/list.html')
| -rw-r--r-- | layouts/list.html | 39 |
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 }} |
