Last active
January 11, 2018 01:39
-
-
Save jgreely/7e4b01abd7427ce4344dc6d06d90d87e to your computer and use it in GitHub Desktop.
layouts/partials/pagination.html: scalable replacement for Hugo _internal/pagination.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ $pag := $.Paginator }} | |
{{ if gt $pag.TotalPages 1 }} | |
<ul class="pagination"> | |
{{ with $pag.First }} | |
<li class="first {{ if not $pag.HasPrev }}disabled{{ end }}"><a href="{{ .URL }}" aria-label="First"><span aria-hidden="true">««</span></a></li> | |
{{ end }} | |
<li class="previous {{ if not $pag.HasPrev }}disabled{{ end }}"><a href="{{ if $pag.HasPrev }}{{ $pag.Prev.URL }}{{ end }}" aria-label="Previous"><span aria-hidden="true">«</span></a></li> | |
<li class="active"><a href="{{ $pag.URL }}">{{ $pag.PageNumber }}</a></li> | |
<li class="next {{ if not $pag.HasNext }}disabled{{ end }}" aria-label="Next"><a href="{{ if $pag.HasNext }}{{ $pag.Next.URL }}{{ end }}"><span aria-hidden="true">»</span></a></li> | |
{{ with $pag.Last }}<li class="last {{ if not $pag.HasNext }}disabled{{ end }}"><a href="{{ .URL }}" aria-label="Last" title="{{$pag.TotalPages}}"><span aria-hidden="true">»»</span></a></li> | |
{{ end }} | |
</ul> | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment