{{ $paginator := $.Paginator }}
{{ if gt $paginator.TotalPages 1 }}
<nav class="paginator" aria-label="page">
    <ul class="pagination pagination-sm">
        <li class="page-item{{ if not $paginator.HasPrev }} disabled{{ end }}">
            <a class="page-link" href="{{ if $paginator.HasPrev }}{{ $paginator.Prev.URL }}{{ else }}javascript:void(0){{ end }}">⮂ Previous</a>
        </li>
        {{ if lt $paginator.TotalPages 10 }}
        {{ range $paginator.Pagers }}
        <li class="page-item{{ if eq . $paginator}} active{{ end }}">
            <a class="page-link" href="{{ .URL }}">{{ .PageNumber }}{{ if eq . $paginator}}<span class="sr-only"></span>{{ end }}</a>
        </li>
        {{ end }}
        {{ else }}
        <li class="page-item too-many">Page {{ $paginator.PageNumber }} of {{ $paginator.TotalPages }}</li>
        {{ end }}
        <li class="page-item{{ if not $paginator.HasNext }} disabled{{ end }}">
            <a class="page-link" href="{{ if $paginator.HasNext }}{{ $paginator.Next.URL }}{{ else }}javascript:void(0){{ end }}">Next ⮀</a>
        </li>
    </ul>
</nav>
{{ end }}
