aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/pagination.html
blob: ec899fdf6fc0de8b43d7983cd9f6276d19582498 (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"{{ else }}class="pagination-enabled"{{ 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 }}