Configure page
Configure page behavior.
The default sort order for page collections, used when no other criteria are set, follows this priority:
weight(ascending)date(descending)linkTitlefalling back totitle(ascending)- Path relative to the
contentdirectory, including the file extension and any language identifier, converted to lower case with spaces replaced by hyphens (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:
November 8, 2026
:
content: Remove categories from front matter (1cc1dd83a)
Improve this page