Back to Hugo

Configure page

docs/content/en/configuration/page.md

0.163.31.4 KB
Original Source

{{% glossary-term "default sort order" %}}

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:

This is based on this default project configuration:

{{< code-toggle config=page />}}

nextPrevInSectionSortOrder : (string) The sort order used to determine the next and previous page within the same section when calling NextInSection or PrevInSection on a Page object. Valid values are asc (ascending) or desc (descending). Default is desc.

nextPrevSortOrder : (string) The sort order used to determine the next and previous page when calling Next or Prev on a Page object. Valid values are asc (ascending) or desc (descending). Default is desc.

To reverse the meaning of next and previous:

{{< code-toggle file=hugo >}} [page] nextPrevInSectionSortOrder = 'asc' nextPrevSortOrder = 'asc' {{< /code-toggle >}}

[!NOTE] These settings do not apply to the Next or Prev methods on a Pages object.