mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit '7125ad401ad043e46262afc7eca8dceb6d54bb9e'
This commit is contained in:
@@ -15,18 +15,18 @@ Use the `Children` method when rendering a nested menu.
|
||||
With this site configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Products'
|
||||
pageRef = '/product'
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Product 1'
|
||||
pageRef = '/products/product-1'
|
||||
parent = 'Products'
|
||||
weight = 1
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Product 2'
|
||||
pageRef = '/products/product-2'
|
||||
parent = 'Products'
|
||||
|
@@ -15,18 +15,18 @@ Use the `HasChildren` method when rendering a nested menu.
|
||||
With this site configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Products'
|
||||
pageRef = '/product'
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Product 1'
|
||||
pageRef = '/products/product-1'
|
||||
parent = 'Products'
|
||||
weight = 1
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Product 2'
|
||||
pageRef = '/products/product-2'
|
||||
parent = 'Products'
|
||||
|
@@ -14,13 +14,13 @@ The `Identifier` method returns the `identifier` property of the menu entry. If
|
||||
[automatically]: /content-management/menus/#define-automatically
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
identifier = 'about'
|
||||
name = 'About'
|
||||
pageRef = '/about'
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
identifier = 'contact'
|
||||
name = 'Contact'
|
||||
pageRef = '/contact'
|
||||
|
@@ -12,13 +12,13 @@ action:
|
||||
In this menu definition, the second entry does not contain an `identifier`, so the `Identifier` method returns its `name` property instead:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
identifier = 'about'
|
||||
name = 'About'
|
||||
pageRef = '/about'
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Contact'
|
||||
pageRef = '/contact'
|
||||
weight = 20
|
||||
|
@@ -5,7 +5,7 @@ categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related: []
|
||||
returnType: hugolib.pageState
|
||||
returnType: page.Page
|
||||
signatures: [MENUENTRY.Page]
|
||||
---
|
||||
|
||||
@@ -14,15 +14,15 @@ Regardless of how you [define menu entries], an entry associated with a page has
|
||||
In this menu definition, the first two entries are associated with a page, the last entry is not:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
pageRef = '/about'
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
pageRef = '/contact'
|
||||
weight = 20
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Hugo'
|
||||
url = 'https://gohugo.io'
|
||||
weight = 30
|
||||
|
@@ -12,21 +12,21 @@ action:
|
||||
When you define menu entries [in site configuration] or [in front matter], you can include a `params` key to attach additional information to the entry. For example:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'About'
|
||||
pageRef = '/about'
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Contact'
|
||||
pageRef = '/contact'
|
||||
weight = 20
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Hugo'
|
||||
url = 'https://gohugo.io'
|
||||
weight = 30
|
||||
[menu.main.params]
|
||||
[menus.main.params]
|
||||
rel = 'external'
|
||||
{{< /code-toggle >}}
|
||||
|
||||
|
@@ -12,19 +12,18 @@ action:
|
||||
With this menu definition:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[menu]
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Products'
|
||||
pageRef = '/product'
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Product 1'
|
||||
pageRef = '/products/product-1'
|
||||
parent = 'Products'
|
||||
weight = 1
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Product 2'
|
||||
pageRef = '/products/product-2'
|
||||
parent = 'Products'
|
||||
|
@@ -7,14 +7,14 @@ In this site configuration we enable rendering of [emoji shortcodes], and add em
|
||||
{{< code-toggle file=hugo >}}
|
||||
enableEmoji = true
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'About'
|
||||
pageRef = '/about'
|
||||
post = ':point_left:'
|
||||
pre = ':point_right:'
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
[[menus.main]]
|
||||
name = 'Contact'
|
||||
pageRef = '/contact'
|
||||
post = ':arrow_left:'
|
||||
|
Reference in New Issue
Block a user