aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials/pagination.html
blob: 93c7b0be7c23cdb9850b93808ad11b760343f15f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
<nav class="flex items-center justify-center pa4 f5">
    {{ if $pag.HasPrev }}
      <a href="{{ $pag.Prev.URL }}" rel="prev" class="near-black grow hover-bg-light-gray p-2 ba">« {{ T "prev" }}</a>
    {{ end }}
    {{ range $pag.Pagers }}
    {{ if eq . $pag }}
      <span class= "near-white bg-gray m-1 p-2 ba"> {{ $pag.PageNumber }}</span>
    {{ else }}
      <a href="{{ .URL }}" class="block near-black grow hover-bg-light-gray hover-near-black p-2 ba">{{ .PageNumber }}</a>
    {{ end }}
    {{ end }}
    {{ if $pag.HasNext }}
    <a href="{{ $pag.Next.URL }}" rel="next" class="near-black grow hover-bg-light-gray p-2 ba">{{ T "next" }} »</a> {{ end }}
</nav>
{{ end }}