Update menu-templates.md

Adding a note that not all first-level directories are sections and including a link to Content Sections, which explains in more detail.
This commit is contained in:
Atrian Wagner 2021-07-04 01:02:07 -04:00 committed by Bjørn Erik Pedersen
parent 284dc4266c
commit 899b7117ce

View File

@ -76,9 +76,11 @@ To enable this menu, configure `sectionPagesMenu` in your site `config`:
sectionPagesMenu = "main" sectionPagesMenu = "main"
``` ```
The menu name can be anything, but take a note of what it is. The menu name can be anything, but take a note of what it is.
This will create a menu with all the sections as menu items and all the sections' pages as "shadow-members". The _shadow_ implies that the pages isn't represented by a menu-item themselves, but this enables you to create a top-level menu like this: This will create a menu with all the sections as menu items and all the sections' pages as "shadow-members". Ensure that all first level directories that you would like to show up on this menu are [Branch Bundles](https://gohugo.io/content-management/sections/). Leaf Bundles do not form sections.
The _shadow_ implies that the pages isn't represented by a menu-item themselves, but this enables you to create a top-level menu like this:
``` ```
<nav class="sidebar-nav"> <nav class="sidebar-nav">
@ -179,4 +181,4 @@ Here's an example:
{{% note %}} {{% note %}}
With Menu-level .Params they can easily exist on one menu item but not another. It's recommended to access them gracefully using the [with function](/functions/with). With Menu-level .Params they can easily exist on one menu item but not another. It's recommended to access them gracefully using the [with function](/functions/with).
{{% /note %}} {{% /note %}}