Control pagination and page collections from baseof.html


git clone --single-branch -b hugo-forum-topic-37643 hugo-forum-topic-37643
cd hugo-forum-topic-37643
hugo server

To verify that we’re not clobbering our pagination parameters:

  • The articles list page will show 3 articles per pager, by title
  • The books list page will show 5 books per pager, by title (reversed)
  • The films list page will show 7 films per pager, by date
  • The quotations list page will not be paginated


At the top of the file we define our pagination strategy, by section, for the entire site. This means that later on in the file we have access to the paginator properties (e.g., the current pager number, total number of pagers, etc.).


Uses a conditional to define the page collection, mirroring the logic used in layouts/_default/baseof.html.


While this is functional, it makes pagination a “site wide” feature, instead of something you can just add when needed on any given list page. For example, with this approach, you cannot easily split an article into multiple pages using this method.