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)linkTitlefalling 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:
NextandPrevNextInSectionandPrevInSection
This is based on this default project configuration:
page:
nextPrevInSectionSortOrder: desc
nextPrevSortOrder: desc
[page]
nextPrevInSectionSortOrder = 'desc'
nextPrevSortOrder = 'desc'
{
"page": {
"nextPrevInSectionSortOrder": "desc",
"nextPrevSortOrder": "desc"
}
}
nextPrevInSectionSortOrder- (
string) The sort order used to determine the next and previous page within the same section when callingNextInSectionorPrevInSectionon aPageobject. Valid values areasc(ascending) ordesc(descending). Default isdesc. nextPrevSortOrder- (
string) The sort order used to determine the next and previous page when callingNextorPrevon aPageobject. Valid values areasc(ascending) ordesc(descending). Default isdesc.
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:
May 25, 2026
:
content: Wrap relevant description list terms in backticks (911c1c754)
Improve this page