joinpeertube/themes/hugo-bootstrap-premium/layouts/partials/modules/site/pagination.html
2018-02-28 16:33:36 +01:00

33 lines
1.1 KiB
HTML

{{ $baseurl := .Site.BaseURL }}
{{ $pag := .Paginator }}
{{ if gt $pag.TotalPages 1 }}
<li {{ if not $pag.HasPrev }} class="disabled" {{ end }}>
<a aria-label="First" href="{{ $baseurl }}{{ $pag.First.URL }}">
<span aria-hidden="true">&laquo;&laquo;</span>
</a>
</li>
<li {{ if not $pag.HasPrev }} class="disabled" {{ end }}>
<a aria-label="Previous" href="{{ if $pag.HasPrev }}{{ $baseurl }}{{ $pag.Prev.URL }}{{ else }}#{{ end }}">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
{{ range $pag.Pagers }}
<li {{ if eq . $pag }} class="active" {{ end }}>
<a href="{{ $baseurl }}{{ .URL }}">
{{ .PageNumber }}
</a>
</li>
{{ end }}
<li {{ if not $pag.HasNext }} class="disabled" {{ end }}>
<a aria-label="Next" href="{{ if $pag.HasNext }}{{ $baseurl }}{{ $pag.Next.URL }}{{ else }}#{{ end }}">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
<li {{ if not $pag.HasNext }} class="disabled" {{ end }}>
<a aria-label="Last" href="{{ $baseurl }}{{ $pag.Last.URL }}">
<span aria-hidden="true">&raquo;&raquo;</span>
</a>
</li>
{{ end }}