Specifying specific page order

I’m starting out using Hugo for some content that I want to present in a specific page order. Hence, the finished site will be more like a book (where pages are in a specific order and there is no chronology) rather than a blog (where pages are listed in reverse chronological order). If it matters, I’m currently using the Mainroad theme.

For now, I have the pages events.md, processors.md, and queues.md. As it happens, I want them to be presented in that order, i.e., events.md is the first page and queues.md is the last page. (I will add more pages later.)

When I generate the site and view the page generated from events.md, it lists “Processors” as the “Previous” page (along with a link) at the bottom of the page. But that’s wrong: “Processors” is the next page. (I assume it does this because the “Processors” page is the “previous” page in reverse alphabetical order.)

How can I specify a specific page ordering? I.e., which page is the first, which is the last, and (for each page), which page is next and which is previous?

You can set weight in front matter. I suggest you start with 10 (or something for the first), then 20, 30 … This allows you to insert pages where you want later without having to reorder them all.

That does establish a definite order, yes, but if I make events.md (the first page) be 10 and the rest be 20, 30, etc., then the table of contents is in the correct order, but the Previous/Next links are still backwards. If I number in reverse order (e.g., 30, 20, 10) then the Previous/Next links are correct but the table of contents is in reverse order.

The Prev/Next is a long story in Hugo:

The main point is: A page with weight 10 is (by the default page sort) ordered before a page with weight 20.