aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/pagination.html
blob: e2724ecf84ded0f463845aeda70abab7b7d2c3e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{{- $pag := $.Paginator -}}
{{- if gt $pag.TotalPages 1 -}}
<ul class="pagination">
	{{ with $pag.First -}}
	<li {{ if $pag.HasPrev }}class="pagination-enabled"{{ else }}class="pagination-disabled"{{ end }}>
		<a {{ if $pag.HasPrev }}href="{{ .URL }}"{{ end }} aria-label="First"><span aria-hidden="true">&laquo;</span></a>
	</li>
	{{ end -}}
	{{- range $pag.Pagers -}}
	<li{{ if eq . $pag }} class="pagination-active"{{ end }}>
		<a href="{{ .URL }}">{{ .PageNumber }}</a>
	</li>
	{{- end }}
	{{- with $pag.Last }}
	<li {{ if $pag.HasNext }}class="pagination-enabled"{{ else }}class="pagination-disabled"{{ end }}>
		<a {{ if $pag.HasNext }}href="{{ .URL }}"{{ end }} aria-label="Last"><span aria-hidden="true">&raquo;</span></a>
	</li>
	{{- end }}
</ul>
{{ end }}