How to paginate a subdirectory?

I stumbled across the same problem: I have a /content/blog section also, and want templates/index.html to paginate over it. Doing a get_section(path="blog/_index.md") doesn’t get you a paginator. It has a property pages though, over which you can iterate.

The comment by Zola’s author keats with transparent = true in the _index.md located in the blog section was the most helpful one so far. Now I have a paginator. Everything seems fine. And it actually is.

But, one caveat for me: I had pages like about.md, imprint.md, etc. under /content, which are now also used for the paginator. Implementing some filter logic didn’t work, because of date and sort_by issues - leaving out some pages in the middle while having a paginate_by leads to ugly results.

I ended up with all my pages in its own section: /content/pages, which led to a cleaner template implementation.