Pagination - how to include both single and list pages?

Hi,
this may have an elementary solution, however I just have a basic understanding of how Hugo works and I’ve been searching all over the Docs and forums and didn’t find it:

I want to build pagination on a list page which is not a root section (it’s one level deeper) and I want it to list all pages living under this list page (which are both single and list pages). I found out that using the basic {{ range .Paginator.Pages }} I’ll only get the single pages (regular pages) not the list ones.

To speak concretely, this is my content organization:

- content/
    - blog/
    - comics/
        - one-comics/
        - comics-group/
            - some-comics/ (leaf bundle)
            - one-subgroup/ (branch bundle)
            - another-subgroup/ (branch bundle)
                ...

and I want to build pagination in the comics-group/_index.md page to include some-comics, one-subgroup and another-subgroup. I only know how to get some-comics.

Could you please give me a hint?

look here

You must have a list of all your pages and the create the Paginator with this list.
Something like this:

{{ $paginator := .Paginate (where .Pages "Section" "comics") }}

Thank you! That solved my situation!

I had no idea filtering the list with with the higher level section would help create the list I needed.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.