{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
<nav aria-label="Page navigation">
    <ul class="pagination">
        {{ if $pag.HasPrev }}
        <li class="page-item"><a href="{{ $pag.Prev.URL }}" rel="prev" class="page-link page-prev">Prev</a></li>
        {{ end }}
        {{ range $pag.Pagers }}
        {{ if eq . $pag }}
        <li class="page-item active"><a href="{{ .URL }}" class="page-link">{{ .PageNumber }}</a></li>
        {{ else }}
        <li class="page-item"><a href="{{ .URL }}" class="page-link">{{ .PageNumber }}</a></li>
        {{ end }}
        {{ end }}

        {{ if $pag.HasNext }}
        <li class="page-item"><a href="{{ $pag.Next.URL }}" rel="next" class="page-link page-next">Next</a></li>
        {{ end }}
    </ul>
</nav>
{{ end }}