Add code toggle to menus page (#1568)

Closes #1299
This commit is contained in:
Joe Mooring 2021-11-04 11:04:15 -07:00 committed by GitHub
parent 2d0f38978b
commit c3088c4fcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ menu:
docs:
parent: "content-management"
weight: 120
weight: 120 #rem
weight: 120
aliases: [/extras/menus/]
toc: true
---
@ -48,31 +48,24 @@ If all you need to do is add an entry to a menu, the simple form works well.
#### A Single Menu
```
---
{{< code-toggle >}}
menu: "main"
---
```
{{< /code-toggle >}}
#### Multiple Menus
```
---
{{< code-toggle >}}
menu: ["main", "footer"]
---
```
{{< /code-toggle >}}
#### Advanced
```
---
{{< code-toggle >}}
menu:
docs:
parent: 'extras'
weight: 20
---
```
{{< /code-toggle >}}
## Add Non-content Entries to a Menu
@ -115,7 +108,7 @@ In this example, the top level of the menu is defined in your [site `config` fil
## Params
You can also add user-defined content to menu items via the `params` field.
You can also add user-defined content to menu items via the `params` field.
A common use case is to define a custom param to add a css class to a specific menu item.
@ -130,7 +123,6 @@ A common use case is to define a custom param to add a css class to a specific m
class = "highlight-menu-item"
{{</ code-toggle >}}
## Render Menus
See [Menu Templates](/templates/menu-templates/) for information on how to render your site menus within your templates.