diff --git a/docsy.dev/content/en/docs/content/navigation.md b/docsy.dev/content/en/docs/content/navigation.md index 0b0c9424a0..37c241e21a 100644 --- a/docsy.dev/content/en/docs/content/navigation.md +++ b/docsy.dev/content/en/docs/content/navigation.md @@ -75,6 +75,50 @@ Navbar entries are ordered from left to right by `weight`. So, for example, a section index or page with `weight: 30` would appear after the Documentation section in the menu, while one with `weight: 10` would appear before it. +To group menu items in a dropdown, add a `parent` parameter to the page front +matter. All menu items with the same `parent` value will be grouped together +under a dropdown menu. For example, here's how to add a page to a +"Community" dropdown: + +{{< tabpane >}} +{{< tab header="Front matter:" disabled=true />}} +{{< tab header="toml" lang="toml" >}} ++++ +title = "Contributing to the Project" +linkTitle = "Contributing" +description = "How to contribute to our documentation project." + +[menu.main] +parent = "Community" +weight = 10 ++++ +{{< /tab >}} +{{< tab header="yaml" lang="yaml" >}} +--- +title: "Contributing to the Project" +linkTitle: "Contributing" +description: "How to contribute to our documentation project." +menu: + main: + parent: "Community" + weight: 10 +--- +{{< /tab >}} +{{< tab header="json" lang="json" >}} +{ + "title": "Contributing to the Project", + "linkTitle": "Contributing", + "description": "How to contribute to our documentation project.", + "menu": { + "main": { + "parent": "Community", + "weight": 10 + } + } +} +{{< /tab >}} +{{< /tabpane >}} + If you want to add a link to an external site to this menu, add it to your site configuration:[^add-external-link-via] diff --git a/layouts/_partials/navbar-general-selector.html b/layouts/_partials/navbar-general-selector.html new file mode 100644 index 0000000000..5015eff0e9 --- /dev/null +++ b/layouts/_partials/navbar-general-selector.html @@ -0,0 +1,13 @@ + + {{ .menuItem.Name }} + +
diff --git a/layouts/_partials/navbar.html b/layouts/_partials/navbar.html index a188c80b50..570a58f836 100644 --- a/layouts/_partials/navbar.html +++ b/layouts/_partials/navbar.html @@ -27,15 +27,20 @@