-
-
Notifications
You must be signed in to change notification settings - Fork 358
feat: allow authors to set the value of reversePagination in page front matter #674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…m parameter along with an example of how to use it and why you might want to use it
✅ Deploy Preview for hugo-hextra ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, this looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR makes pagination direction configurable per page by reading a reversePagination flag from front matter and adds docs to guide authors on its usage.
- The blog single template now defaults
reversePaginationto the page’s param instead of alwaystrue. - Documentation in the example site was added to explain how to toggle pagination order via front matter.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| layouts/blog/single.html | Use .Params.reversePagination with a default instead of hardcoded true |
| exampleSite/content/docs/guide/organize-files.md | New section on section pagination order and front-matter configuration |
Comments suppressed due to low confidence (1)
layouts/blog/single.html:43
- Consider adding automated tests to verify that when
reversePaginationis set totrueorfalsein front matter, the pager correctly flips navigation links.
{{- .Scratch.Set "reversePagination" (.Params.reversePagination | default true) -}}
| 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`. | ||
|
|
||
| #### Example | ||
|
|
Copilot
AI
May 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] It may help to explicitly note that reversePagination must be placed under the params: section in your front matter (e.g., params:\n reversePagination: false).
| 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`. | |
| #### Example | |
| 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`. | |
| Note: The `reversePagination` parameter must be placed under the `params:` section in the front matter for it to work correctly. | |
| #### Example | |
| ```yaml {filename="content/blog/_index.md"} | |
| --- | |
| title: Blog | |
| params: | |
| reversePagination: false | |
| --- |
Currently, there is no way for authors to choose the order in which
PAGE.PrevInSectionandPAGE.NextInSectionare ordered for navigation in the footer of a page.This PR just changes the
reversePaginationinput inlayouts/partials/components/pager.htmlfrom being hardcoded totrue, to being set from the page front matter like so:This allows authors to disable this reverse authoring on a per page basis or use the
cascadefront matter to set it on entire page sections.