Debian Codegraph @

docs/content/en/configuration/page.md

raw
1 ---
2 title: Configure page
3 linkTitle: Page
4 description: Configure page behavior.
5 categories: []
6 keywords: []
7 ---
8
9 {{% glossary-term "default sort order" %}}
10
11 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:
12
13 - [`Next`][] and [`Prev`][]
14 - [`NextInSection`][] and [`PrevInSection`][]
15
16 This is based on this default project configuration:
17
18 {{< code-toggle config=page />}}
19
20 `nextPrevInSectionSortOrder`
21 : (`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`.
22
23 `nextPrevSortOrder`
24 : (`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`.
25
26 To reverse the meaning of _next_ and _previous_:
27
28 {{< code-toggle file=hugo >}}
29 [page]
30 nextPrevInSectionSortOrder = 'asc'
31 nextPrevSortOrder = 'asc'
32 {{< /code-toggle >}}
33
34 > [!NOTE]
35 > These settings do not apply to the [`Next`][next-pages] or [`Prev`][prev-pages] methods on a `Pages` object.
36
37 [`NextInSection`]: /methods/page/nextinsection/
38 [`Next`]: /methods/page/next/
39 [`PrevInSection`]: /methods/page/previnsection/
40 [`Prev`]: /methods/page/prev/
41 [next-pages]: /methods/pages/next/
42 [prev-pages]: /methods/pages/prev/