hugo-theme-relearn/exampleSite/content/configuration/sidebar/navigationmenu/_index.en.md

48 lines
1.8 KiB
Markdown
Raw Normal View History

2024-09-29 21:48:56 +00:00
+++
description = "Default behavior of the navigation menu"
2024-10-06 18:37:18 +00:00
options = ["alwaysopen", "collapsibleMenu", "ordersectionsby"]
2024-09-29 21:48:56 +00:00
title = "Navigation Menu"
weight = 4
+++
2024-10-07 13:30:53 +00:00
The navigation menu is automatically created from [your content files](content/organization).
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
All configurations options apply to all pages but can be changed in each page's front matter.
2024-09-29 21:48:56 +00:00
## Expand State of Nested Sections
2024-10-07 13:30:53 +00:00
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} Use `alwaysopen` to control how submenus appear. Set it to `true` to expand submenus, or `false` to collapse them. If not set, the first menu level is collapsed, and all others are expanded.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
{{< multiconfig file=hugo >}}
[params]
alwaysopen = true
{{< /multiconfig >}}
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
The current page's submenus are always expanded, regardless of this setting.
2024-09-29 21:48:56 +00:00
## Expander for Nested Sections
2024-10-07 13:30:53 +00:00
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} Set `collapsibleMenu=true` to add an expander for submenus. This shows submenus as collapsible trees with a clickable expander.
{{< multiconfig file=hugo >}}
[params]
collapsibleMenu = true
{{< /multiconfig >}}
2024-09-29 21:48:56 +00:00
> [!WARNING]
2024-10-07 13:30:53 +00:00
> Using this option may slow down your build process, especially with many pages.
2024-09-29 21:48:56 +00:00
>
2024-10-07 13:30:53 +00:00
> We've seen builds taking 2 minutes with 1000+ pages, and over 30 minutes with 5000+ pages.
2024-09-29 21:48:56 +00:00
>
2024-10-07 13:30:53 +00:00
> This happens because each new page affects all other pages, leading to exponentially longer build times.
2024-09-29 21:48:56 +00:00
## Default Sort By
2024-10-07 13:30:53 +00:00
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} Use `ordersectionsby` to choose how navigation menus are sorted. The default is `weight`. You can sort by `weight`, `title`, `linktitle`, `modifieddate`, `expirydate`, `publishdate`, `date`, `length`, or `default` (Hugo's standard order).
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
{{< multiconfig file=hugo >}}
[params]
ordersectionsby = 'weight'
{{< /multiconfig >}}