mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit 'dec8cd4ada29218971743333f8ac662a9c06aad8'
This commit is contained in:
@@ -378,6 +378,10 @@ Module configuration see [module configuration](/hugo-modules/configuration/).
|
||||
|
||||
See [custom output formats].
|
||||
|
||||
###### page
|
||||
|
||||
See [configure page](#configure-page).
|
||||
|
||||
###### pagination
|
||||
|
||||
See [configure pagination](/templates/pagination/#configuration).
|
||||
@@ -496,6 +500,50 @@ enableemoji: true
|
||||
```
|
||||
{{% /note %}}
|
||||
|
||||
## Configure page
|
||||
|
||||
{{< new-in 0.133.0 >}}
|
||||
|
||||
These methods on a `Page` object navigate to the next or previous page within a page collection, relative to the current page:
|
||||
|
||||
- [Next](/methods/page/next/)
|
||||
- [NextInSection](/methods/page/nextinsection/)
|
||||
- [Prev](/methods/page/prev/)
|
||||
- [PrevInSection](/methods/page/previnsection/)
|
||||
|
||||
Hugo determines the _next_ and _previous_ page by sorting a page collection according to this sorting hierarchy:
|
||||
|
||||
Field|Precedence|Sort direction
|
||||
:--|:--|:--
|
||||
[`weight`]|1|descending
|
||||
[`date`]|2|descending
|
||||
[`linkTitle`]|3|descending
|
||||
[`path`]|4|descending
|
||||
|
||||
[`date`]: /methods/page/date/
|
||||
[`weight`]: /methods/page/weight/
|
||||
[`linkTitle`]: /methods/page/linktitle/
|
||||
[`path`]: /methods/page/path/
|
||||
|
||||
The sort direction in the table above corresponds to these default site configuration values:
|
||||
|
||||
{{< code-toggle config=page />}}
|
||||
|
||||
To sort all fields in ascending order:
|
||||
|
||||
{{< 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.
|
||||
|
||||
[`Next`]: /methods/pages/next
|
||||
[`Prev`]: /methods/pages/next
|
||||
{{% /note %}}
|
||||
|
||||
## Configure build
|
||||
|
||||
The `build` configuration section contains global build-related configuration options.
|
||||
@@ -609,8 +657,6 @@ Setting `force=true` will make a redirect even if there is existing content in t
|
||||
|
||||
## 404 server error page {#_404-server-error-page}
|
||||
|
||||
{{< new-in 0.103.0 >}}
|
||||
|
||||
Hugo will, by default, render all 404 errors when running `hugo server` with the `404.html` template. Note that if you have already added one or more redirects to your [server configuration](#configure-server), you need to add the 404 redirect explicitly, e.g:
|
||||
|
||||
{{< code-toggle file=config/development/server >}}
|
||||
@@ -924,7 +970,6 @@ output
|
||||
|
||||
It is recommended to put coarse grained filters (e.g. for language and output format) in the excludes section, e.g.:
|
||||
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[segments.segment1]
|
||||
[[segments.segment1.excludes]]
|
||||
|
Reference in New Issue
Block a user