mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
@@ -113,6 +113,24 @@ This means that `.Title` will be used unless `.LinkTitle` is present, etc. In pr
|
||||
|
||||
In this example, the top level of the menu is defined in your [site `config` file][config]. All content entries are attached to one of these entries via the `.Parent` field.
|
||||
|
||||
## Params
|
||||
|
||||
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.
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
[[menu.main]]
|
||||
name = "about hugo"
|
||||
pre = "<i class='fa fa-heart'></i>"
|
||||
weight = -110
|
||||
identifier = "about"
|
||||
url = "/about/"
|
||||
[menu.main.params]
|
||||
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.
|
||||
|
Reference in New Issue
Block a user