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