@jmooring, Pagination Reverse Date Order - Massively Theme
{{ $dir := "reports"}}
<div class="[ x--wide ]">
{{ $paginator := .Paginate (where .Data.Pages "Section" "reports") }}
<ul class="[ loop ] [ mb--2 ]">
{{ range $paginator.Pages.ByTitle.Reverse }}
<li class="[ loop__item ] [ flex--between flex--wrap p--1 mb--050 ]">
<div>
<h3 class="[ h5 mb--025 ]"><a href="{{ .Permalink }}">COVID-19 Case Report {{ .Title }}</a></h3>
<p>{{ .Date | dateFormat "Monday, Jan 2, 2006" }}</p>
</div>
<div>
<a href="{{ .Permalink }}index.json">View JSON</a>
</div>
</li>
{{ end }}
</ul>
Posts are titled 515-560. Default pagination works fine and follows the numbering sequence, but .Reverse
changes the order, but it doesn’t start the listing on the first page from 560, just changes the order of the posts on the page — ie. 515-545 becomes 545-515, 548-557 becomes 557-548.
What I’m looking for is a descending pattern as you progress throughout the paginated pages.