I can’t seem to change PageSize from the default value of 10.
I’ve tried setting paginate = 6 in config.toml (as a top-level property), and I’ve also tried setting the limit explicitly via {{ $paginator := .Paginate (where .Pages "section" "posts") 6 }}. No matter what, {{$paginator.PageSize}} prints 6.
Pagination does seem to work, as I created 20 placeholder posts and localhost/page/2 showed with 10 posts on each page.
If you call .Paginator or .Paginate multiple times on the same page, you should ensure all the calls are identical. Once either.Paginator or .Paginate is called while generating a page, its result is cached, and any subsequent similar call will reuse the cached result. This means that any such calls which do not match the first one will not behave as written.
If you need further assistance…
Let us see your code
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
@jmooring ah you’re quick! I’m only invoking pagination once on that page.
Here’s my code, if you don’t mind taking a quick look. It’s the list on the front page that I’m having issues with…markup for it is in layouts/index.html.
The top-level table, also called the root table, starts at the beginning of the document and ends just before the first table header (or EOF). Unlike other tables, it is nameless and cannot be relocated.