summaryrefslogtreecommitdiff
path: root/layouts/blog/list.html
blob: a0d51e2fd0bf03b0263bf234f2cf1cc28f1ef040 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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}}