The `sort` template func was producing a `[]page.Page` which did not work in `.Paginate`. Fixes #6023
Fixes #5808