aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials/pagination.html
blob: 16ad74e467aa5c9710c99955315c071ee438e77f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
<div class="center db tc ma4 f6">
    {{ if $pag.HasPrev }}
        <a href="{{ $pag.Prev.URL }}" aria-label="Previous" class="dib link dim ph3 pv2 ba br1 ttu">Newer Posts</a>
    {{ end }}

    {{ range $pag.Pagers }}
    <a href="{{ .URL }}" class="dib link dim ph3 pv2 b ba br1 {{ if eq . $pag }}bg-blue white{{ end }}">{{ .PageNumber }}</a>
    {{ end }}
{{ if $pag.HasNext }}
    <a href="{{ $pag.Next.URL }}" aria-label="Next" class="dib link dim ph3 pv2 ba br1 ttu">Older posts</a>
{{ end }}
</div>
{{ end }}