Configure page
Configure page behavior.
New in
v0.133.0The default sort order for page collections, used when no other criteria are set, follows this priority:
weight
(ascending)date
(descending)linkTitle
falling back totitle
(ascending)- logical path (ascending)
Hugo uses the default sort order to determine the next and previous page relative to the current page when calling these methods on a Page
object:
Next
andPrev
NextInSection
andPrevInSection
This is based on this default site configuration:
page:
nextPrevInSectionSortOrder: desc
nextPrevSortOrder: desc
[page]
nextPrevInSectionSortOrder = 'desc'
nextPrevSortOrder = 'desc'
{
"page": {
"nextPrevInSectionSortOrder": "desc",
"nextPrevSortOrder": "desc"
}
}
To reverse the meaning of next and previous:
page:
nextPrevInSectionSortOrder: asc
nextPrevSortOrder: asc
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'
{
"page": {
"nextPrevInSectionSortOrder": "asc",
"nextPrevSortOrder": "asc"
}
}
Last updated:
March 5, 2025
:
content: Consolidate configuration documentation (b6cae5cbc)
Improve this page