-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Labels
Description
Currently there is a way to do prev / next but not 0, 1, 2, ...
<div id="prev-next">
{% if prev-uri %}
<a class="button left" href="{{prev-uri}}">« Prev</a>
{% endif %}
{% if next-uri %}
<a class="button right" href="{{next-uri}}">Next »</a>
{% endif %}
</div>I would like to add numbers between prev and next like in the example below.

To make it possible we need to add data to Selmer with page index, URL, is page active.
Here is a Hugo example:
{{ if gt $paginator.TotalPages 1 }}
<nav>
<ul class="pagination justify-content-center" style="flex-wrap: wrap">
<li class="page-item{{ if not $paginator.HasPrev }} disabled {{ end }}">
<a class="page-link" href="{{ if $paginator.HasPrev }}{{ $paginator.Prev.URL }}{{ end }}">
<span aria-hidden="true">«</span>
</a>
</li>
{{ range .Paginator.Pagers }}
<li class="page-item{{ if eq . $paginator }} active{{ end }}"><a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a></li>
{{ end }}
<li class="page-item{{ if not $paginator.HasNext }} disabled {{ end }}">
<a class="page-link" href="{{ if $paginator.HasNext }}{{ $paginator.Next.URL }}{{ end }}">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
{{ end }}This is the part which Cryogen doesn't have:
{{ range .Paginator.Pagers }}
<li class="page-item{{ if eq . $paginator }} active{{ end }}"><a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a></li>
{{ end }}So we need something in that taste.