Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -3,10 +3,10 @@ title: ByName
description: Returns the given menu with its entries sorted by name.
categories: []
keywords: []
action:
related: []
returnType: navigation.Menu
signatures: [MENU.ByName]
params:
functions_and_methods:
returnType: navigation.Menu
signatures: [MENU.ByName]
---
The `Sort` method returns the given menu with its entries sorted by `name`.

View File

@@ -3,10 +3,10 @@ title: ByWeight
description: Returns the given menu with its entries sorted by weight, then by name, then by identifier.
categories: []
keywords: []
action:
related: []
returnType: navigation.Menu
signatures: [MENU.ByWeight]
params:
functions_and_methods:
returnType: navigation.Menu
signatures: [MENU.ByWeight]
---
The `ByWeight` method returns the given menu with its entries sorted by [`weight`](g), then by `name`, then by `identifier`. This is the default sort order.
@@ -53,11 +53,8 @@ Hugo renders this to:
</ul>
```
{{% note %}}
In the menu definition above, note that the `identifier` property is only required when two or more menu entries have the same name, or when localizing the name using translation tables.
[details]: /content-management/menus/#properties-front-matter
{{% /note %}}
> [!note]
> In the menu definition above, note that the `identifier` property is only required when two or more menu entries have the same name, or when localizing the name using translation tables.
You can also sort menu entries using the [`sort`] function. For example, to sort by `weight` in descending order:

View File

@@ -3,10 +3,10 @@ title: Limit
description: Returns the given menu, limited to the first N entries.
categories: []
keywords: []
action:
related: []
returnType: navigation.Menu
signatures: [MENU.Limit N]
params:
functions_and_methods:
returnType: navigation.Menu
signatures: [MENU.Limit N]
---
The `Limit` method returns the given menu, limited to the first N entries.

View File

@@ -3,10 +3,10 @@ title: Reverse
description: Returns the given menu, reversing the sort order of its entries.
categories: []
keywords: []
action:
related: []
returnType: navigation.Menu
signatures: [MENU.Reverse]
params:
functions_and_methods:
returnType: navigation.Menu
signatures: [MENU.Reverse]
---
The `Reverse` method returns the given menu, reversing the sort order of its entries.

View File

@@ -4,9 +4,4 @@ linkTitle: Menu
description: Use these methods when ranging through menu entries.
categories: []
keywords: []
menu:
docs:
parent: methods
---
Use these methods when ranging through menu entries.