Hi,
I am trying to build a custom pagination for the _default/list.html
template.
The list of paginated items is working as expected.
I would like to use the _internal/pagination.html
template with my custom $paginator
for the navigation, following the docs here, but it’s not working.
Here is part of my code (I have to thank @pointyfar for the solution proposed here:
{{ $pages := where .Data.Pages "Type" .Section }}
{{ $sorted := ($pages.ByParam "myDate").Reverse }}
{{ $paginator := .Paginate $sorted 10 }}
{{ range $paginator.Pages }}
{{ .Title }}
{{ end }}
{{ template "_internal/pagination.html" . }}
Looking at the internal template code here it seems to use .Paginator
to build the navigation menu instead of $paginator
so either:
- am I doing something wrong
- the documentation is not correct
Any ideas?
Thanks!