2021-08-25 13:33:29 +02:00
+++
2024-09-29 23:48:56 +02:00
description = "Add additional shortcut links to the sidebar"
2024-10-05 01:49:00 +02:00
options = ["disableShortcutsTitle"]
2024-09-29 23:48:56 +02:00
title = "Shortcut Menu"
2024-09-21 13:05:58 +02:00
weight = 5
2021-08-25 13:33:29 +02:00
+++
2017-08-20 17:10:29 +02:00
2024-10-07 15:30:53 +02:00
The sidebar contains your content's navigation menu, but you can also add extra menu entries or shortcuts in a separate section.
2017-08-20 17:10:29 +02:00
2024-10-07 15:30:53 +02:00
For internal links, use the `pageRef` property instead of `url` . Learn more about [Hugo's menu configuration ](https://gohugo.io/content-management/menus/#define-in-site-configuration ).
2017-08-20 17:10:29 +02:00
2024-09-29 23:48:56 +02:00
## Title
2017-08-20 17:10:29 +02:00
2024-10-07 15:30:53 +02:00
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} By default, the shortcut menu has a title ("_More_" in English).
2024-09-29 23:48:56 +02:00
2024-10-07 15:30:53 +02:00
You can disable this title with `disableShortcutsTitle=true` .
2024-09-29 23:48:56 +02:00
2024-10-07 15:30:53 +02:00
{{< multiconfig file = hugo > }}
[params]
disableShortcutsTitle = true
{{< / multiconfig > }}
To change the title, update your local i18n translation file.
````toml {title="i18n/en.toml"}
2024-09-29 23:48:56 +02:00
[Shortcuts-Title]
other = "Other Great Stuff"
````
## Single Language Example
2024-10-07 15:30:53 +02:00
Edit `hugo.toml` and add `[[menu.shortcuts]]` entries for each link:
2017-08-20 17:10:29 +02:00
2024-03-02 11:04:52 +01:00
{{< multiconfig file = hugo > }}
2021-08-24 00:25:15 +02:00
[[menu.shortcuts]]
2024-10-06 16:19:13 +02:00
name = "< i class = 'fa-fw fab fa-github' > < / i > GitHub repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
2021-08-24 00:25:15 +02:00
[[menu.shortcuts]]
2024-10-06 16:19:13 +02:00
name = "< i class = 'fa-fw fas fa-camera' > < / i > Showcases"
pageRef = "/showcase"
weight = 11
2021-08-24 00:25:15 +02:00
[[menu.shortcuts]]
2024-10-06 16:19:13 +02:00
name = "< i class = 'fa-fw fas fa-bookmark' > < / i > Hugo Documentation"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
2021-08-24 00:25:15 +02:00
[[menu.shortcuts]]
2024-10-06 16:19:13 +02:00
name = "< i class = 'fa-fw fas fa-bullhorn' > < / i > Credits"
pageRef = "/more/credits"
weight = 30
2021-10-24 11:53:09 +02:00
[[menu.shortcuts]]
2024-10-06 16:19:13 +02:00
name = "< i class = 'fa-fw fas fa-tags' > < / i > Tags"
pageRef = "/tags"
weight = 40
2024-03-02 11:04:52 +01:00
{{< / multiconfig > }}
2017-08-20 17:10:29 +02:00
2024-09-29 23:48:56 +02:00
## Multilingual Example
2017-08-20 17:10:29 +02:00
2024-10-07 15:30:53 +02:00
For multilingual sites, set different menus for each language in `hugo.toml` :
2017-08-20 17:10:29 +02:00
2024-03-02 11:04:52 +01:00
{{< multiconfig file = hugo > }}
2023-05-17 20:58:37 +02:00
[languages]
[languages.en]
2022-02-24 23:09:49 +01:00
title = "Hugo Relearn Theme"
2021-10-24 11:53:09 +02:00
weight = 1
languageName = "English"
2023-05-17 20:58:37 +02:00
[[languages.en.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fab fa-github' > < / i > GitHub repo"
2021-10-24 11:53:09 +02:00
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
2023-05-17 20:58:37 +02:00
[[languages.en.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fas fa-camera' > < / i > Showcases"
2024-10-06 16:19:13 +02:00
pageRef = "/showcase"
2021-10-24 11:53:09 +02:00
weight = 11
2023-05-17 20:58:37 +02:00
[[languages.en.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fas fa-bookmark' > < / i > Hugo Documentation"
2021-10-24 11:53:09 +02:00
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
2023-05-17 20:58:37 +02:00
[[languages.en.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fas fa-bullhorn' > < / i > Credits"
2024-10-06 16:19:13 +02:00
pageRef = "/more/credits"
2021-10-24 11:53:09 +02:00
weight = 30
2023-05-17 20:58:37 +02:00
[[languages.en.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fas fa-tags' > < / i > Tags"
2024-10-06 16:19:13 +02:00
pageRef = "/tags"
2021-10-24 11:53:09 +02:00
weight = 40
2023-05-17 20:58:37 +02:00
[languages.pir]
2022-02-24 23:09:49 +01:00
title = "Cap'n Hugo Relearrrn Theme"
2024-10-07 15:30:53 +02:00
weight = 2
2024-09-29 23:57:23 +02:00
languageName = "Arrr! Pirrratish"
2021-10-24 11:53:09 +02:00
2023-05-17 20:58:37 +02:00
[[languages.pir.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fab fa-github' > < / i > GitHub repo"
2021-10-24 11:53:09 +02:00
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
2023-05-17 20:58:37 +02:00
[[languages.pir.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fas fa-camera' > < / i > Showcases"
2024-10-06 16:19:13 +02:00
pageRef = "/showcase"
2021-10-24 11:53:09 +02:00
weight = 11
2023-05-17 20:58:37 +02:00
[[languages.pir.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fas fa-bookmark' > < / i > Cap'n Hugo Documentat'n"
2021-10-24 11:53:09 +02:00
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
2023-05-17 20:58:37 +02:00
[[languages.pir.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fas fa-bullhorn' > < / i > Crrredits"
2024-10-06 16:19:13 +02:00
pageRef = "/more/credits"
2021-10-24 11:53:09 +02:00
weight = 30
2023-05-17 20:58:37 +02:00
[[languages.pir.menu.shortcuts]]
2024-03-18 17:24:06 +01:00
name = "< i class = 'fa-fw fas fa-tags' > < / i > Arrr! Tags"
2024-10-06 16:19:13 +02:00
pageRef = "/tags"
2021-10-24 11:53:09 +02:00
weight = 40
2024-03-02 11:04:52 +01:00
{{< / multiconfig > }}
2017-08-20 17:10:29 +02:00
2024-10-07 15:30:53 +02:00
## Displaying Pages Only in the Shortcuts Menu
2023-05-19 22:33:27 +02:00
2024-10-07 15:30:53 +02:00
To show pages only in the shortcuts menu you have two choices
2023-05-19 22:33:27 +02:00
2024-10-07 15:30:53 +02:00
1. Create a [headless branch bundle ](https://gohugo.io/content-management/page-bundles/#headless-bundle ), `_index.md` in its own folder with the below front matter. The branch bundle will **not** be contained in the sitemap.
2023-05-19 22:33:27 +02:00
2024-10-06 20:37:18 +02:00
{{< multiconfig fm = true file = "content/showcase/_index.en.md" > }}
2023-09-21 17:23:41 +02:00
title = "Showcase"
2023-05-19 22:33:27 +02:00
[_build]
2023-09-21 17:23:41 +02:00
render = "always"
2023-05-19 22:33:27 +02:00
list = "never"
2023-09-21 17:23:41 +02:00
publishResources = true
2024-03-02 11:04:52 +01:00
{{< / multiconfig > }}
2023-05-19 22:33:27 +02:00
2024-10-07 15:30:53 +02:00
2. Or, put a child page inside a headless branch bundle with the following front matter in the bundle. This causes the child but not the branch bundle to be contained in the sitemap.
2023-05-19 22:33:27 +02:00
2024-10-06 20:37:18 +02:00
{{< multiconfig fm = true file = "content/more/_index.en.md" > }}
2023-05-19 22:33:27 +02:00
[_build]
2023-09-21 17:23:41 +02:00
render = "never"
2023-05-19 22:33:27 +02:00
list = "never"
2023-09-21 17:23:41 +02:00
publishResources = false
2024-03-02 11:04:52 +01:00
{{< / multiconfig > }}
2023-09-21 17:23:41 +02:00
2024-10-07 15:30:53 +02:00
The child page can be any type of content.
2023-09-21 17:23:41 +02:00
2024-10-06 20:37:18 +02:00
{{< multiconfig fm = true file = "content/more/credits_index.en.md" > }}
2023-09-21 17:23:41 +02:00
title = "Credits"
2024-03-02 11:04:52 +01:00
{{< / multiconfig > }}