You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: allow authors to set the value of reversePagination in page front matter (#674)
* Allow authors to set the reverse pagination setting of a page using front matter
* Adding some documentation of the reversePagination front matter custom parameter along with an example of how to use it and why you might want to use it
Copy file name to clipboardExpand all lines: exampleSite/content/docs/guide/organize-files.md
+70Lines changed: 70 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,76 @@ weight: 2
82
82
It is recommended to keep the sidebar not too deep. If you have a lot of content, consider **splitting them into multiple sections**.
83
83
{{< /callout >}}
84
84
85
+
## Section Navigation
86
+
87
+
88
+
### Section Pagination Order
89
+
90
+
The order in which pages, accessed via [`PAGE.PrevInSection`](https://gohugo.io/methods/page/previnsection/) and [`PAGE.NextInSection`](https://gohugo.io/methods/page/nextinsection/) in a [page collection](https://gohugo.io/quick-reference/glossary/#page-collection), are ordered, is reversed by default.
91
+
92
+
To disable this reversed ordering you can set the `reversePagination` custom parameter in the page front matter to `false`. By default `reversePagination` is set to `true`.
If the reader is at the bottom of `post-b/index.md`, they will see that the next page is `post-a`, and the previous page is `post-c`. This is due to `reversePagination` being set to `true` by default. This is ok when we want our posts to be displayed in chronological order from latest to oldest. However, in the case of a blog series where there are multiple parts, we typically want people to read the first post, and then move to the second and so on. So we want to disable the reversed ordering.
141
+
142
+
We can turn off `reversePagination` in every blog post in this series by adding the following front matter to `my-blog-series/_index.md`
We are using [`cascade`](https://gohugo.io/content-management/front-matter/#cascade-1) here to propagate the setting to all posts in the `my-blog-series` so that `reversePagination` is set to `false` for all descendents. This will now ensure that when the reader is on `post-b/index.md` they will see that the next page is `post-c` and the previous page is `post-a`.
154
+
85
155
## Breadcrumb Navigation
86
156
87
157
Breadcrumbs are auto-generated based on the directory structure of `/content`.
0 commit comments