diff options
Diffstat (limited to 'layouts/retired-2024-blog/list.html')
-rw-r--r-- | layouts/retired-2024-blog/list.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/layouts/retired-2024-blog/list.html b/layouts/retired-2024-blog/list.html new file mode 100644 index 0000000..58cb880 --- /dev/null +++ b/layouts/retired-2024-blog/list.html @@ -0,0 +1,38 @@ +{{ define "main" }} + +{{if .Page.Content}} +<article> + {{ .Page.Content }} + </article> +{{ else }} +{{ $paginator := .Paginate .Site.RegularPages.ByDate.Reverse 10 }} + +{{ range $paginator.Pages }} +{{ if eq .Section "blog" }} +{{ partial "partials/blog/full-post.html" . }} +{{ else }} +{{ partial "partials/blog/cross-site-post.html" . }} +{{ end }} +{{ end }} + +<nav class="blog-pages-list"> + Pages: + {{ if $paginator.HasPrev }} + <span>[ <a href="{{ $paginator.Prev.URL}}">previous</a> ]</span> + {{ end }} + + {{ range seq $paginator.TotalPages }} + {{ if eq . $paginator.PageNumber }} + <span class="current"> {{. }} </span> + {{ else }} + <a href="/blog/page/{{ . }}/">{{ . }}</a> + {{ end }} + {{ end }} + + {{ if $paginator.HasNext }} + <span>[ <a href="{{ $paginator.Next.URL}}">Next</a> ]</span> + {{ end }} +</nav> + +{{end}} +{{end}} |