Hi I want to sort my tags alphabetically and paginate them.
{ range sort (.Paginate (.Site.Taxonomies.tags.Alphabetical)).Pages.ByTitle -}}
{{ partial "listing.html" .}}
{{- end }}
What hugo is doing is it is sorting my individual paginated pages but it’s paging in the reverse order. For eg. if my list is A, B, C, D , and my paginate limit is 3 then, it’s making page 1 with (B, C, D) and page 2 with (A).
Basically the post that should be first is going on second page for some reason.
Here is my pagination template
{{ if gt .Paginator.TotalPages 1}}
<!-- Pagination -->
<nav class="pagination" style="margin-bottom: 30px;">
{{ $paginator := .Paginator }}
{{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL }}" class="pagination__page pagination__icon pagination__page--next"
style="padding: 20px;text-decoration: none;"> << </a>
{{ end }}
{{ range .Paginator.Pagers }}
{{ if eq .PageNumber $paginator.PageNumber }}
<span class="pagination__page pagination__page--current"
style="padding: 20px;text-decoration: none;">{{ .PageNumber }}</span>
{{ else }}
<a href="{{ .URL }}" class="pagination__page" style="padding: 20px;text-decoration: none;">{{ .PageNumber }}</a>
{{ end }}
{{ end }}
{{ if .Paginator.HasNext }}
<a href="{{ .Paginator.Next.URL }}" class="pagination__page pagination__icon pagination__page--next"
style="padding: 20px;text-decoration: none;"> >> </a>
{{ end }}
</nav>
{{ end }}
Any help will be appreciated. Thanks.