There must be something wrong with my configuration, as I tried many variations,
including this one that was closed in 2021:
In every case the elements are sorted based on date, not title. I modified the
closed solution by setting {{ $sortedPages := .Pages.ByParam "title" }}
, and
the pages are clearly sorted before they are paginated. The proposed solution
even gets the index of the element on each page of the pagination.