joinpeertube/themes/hugo-bootstrap-premium/layouts/partials/modules/site/pagination.html

34 lines
1.1 KiB
HTML
Raw Normal View History

2018-02-28 15:33:36 +00:00
{{ $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 }}