2021-08-25 11:33:29 +00:00
+++
2024-09-29 21:48:56 +00:00
description = "Add additional shortcut links to the sidebar"
2024-10-04 23:49:00 +00:00
options = ["disableShortcutsTitle"]
2024-09-29 21:48:56 +00:00
title = "Shortcut Menu"
2024-09-21 11:05:58 +00:00
weight = 5
2021-08-25 11:33:29 +00:00
+++
2017-08-20 15:10:29 +00:00
2024-10-07 13:30:53 +00: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 15:10:29 +00:00
2024-10-07 13:30:53 +00: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 15:10:29 +00:00
2024-09-29 21:48:56 +00:00
## Title
2017-08-20 15:10:29 +00:00
2024-10-07 13:30:53 +00:00
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} By default, the shortcut menu has a title ("_More_" in English).
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
You can disable this title with `disableShortcutsTitle=true` .
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00: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 21:48:56 +00:00
[Shortcuts-Title]
other = "Other Great Stuff"
````
## Single Language Example
2024-10-07 13:30:53 +00:00
Edit `hugo.toml` and add `[[menu.shortcuts]]` entries for each link:
2017-08-20 15:10:29 +00:00
2024-03-02 10:04:52 +00:00
{{< multiconfig file = hugo > }}
2021-08-23 22:25:15 +00:00
[[menu.shortcuts]]
2024-10-06 14:19:13 +00: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-23 22:25:15 +00:00
[[menu.shortcuts]]
2024-10-06 14:19:13 +00:00
name = "< i class = 'fa-fw fas fa-camera' > < / i > Showcases"
pageRef = "/showcase"
weight = 11
2021-08-23 22:25:15 +00:00
[[menu.shortcuts]]
2024-10-06 14:19:13 +00:00
name = "< i class = 'fa-fw fas fa-bookmark' > < / i > Hugo Documentation"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
2021-08-23 22:25:15 +00:00
[[menu.shortcuts]]
2024-10-06 14:19:13 +00:00
name = "< i class = 'fa-fw fas fa-bullhorn' > < / i > Credits"
pageRef = "/more/credits"
weight = 30
2021-10-24 09:53:09 +00:00
[[menu.shortcuts]]
2024-10-06 14:19:13 +00:00
name = "< i class = 'fa-fw fas fa-tags' > < / i > Tags"
pageRef = "/tags"
weight = 40
2024-03-02 10:04:52 +00:00
{{< / multiconfig > }}
2017-08-20 15:10:29 +00:00
2024-09-29 21:48:56 +00:00
## Multilingual Example
2017-08-20 15:10:29 +00:00
2024-10-07 13:30:53 +00:00
For multilingual sites, set different menus for each language in `hugo.toml` :
2017-08-20 15:10:29 +00:00
2024-03-02 10:04:52 +00:00
{{< multiconfig file = hugo > }}
2023-05-17 18:58:37 +00:00
[languages]
[languages.en]
2022-02-24 22:09:49 +00:00
title = "Hugo Relearn Theme"
2021-10-24 09:53:09 +00:00
weight = 1
languageName = "English"
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fab fa-github' > < / i > GitHub repo"
2021-10-24 09:53:09 +00:00
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fas fa-camera' > < / i > Showcases"
2024-10-06 14:19:13 +00:00
pageRef = "/showcase"
2021-10-24 09:53:09 +00:00
weight = 11
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fas fa-bookmark' > < / i > Hugo Documentation"
2021-10-24 09:53:09 +00:00
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fas fa-bullhorn' > < / i > Credits"
2024-10-06 14:19:13 +00:00
pageRef = "/more/credits"
2021-10-24 09:53:09 +00:00
weight = 30
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fas fa-tags' > < / i > Tags"
2024-10-06 14:19:13 +00:00
pageRef = "/tags"
2021-10-24 09:53:09 +00:00
weight = 40
2023-05-17 18:58:37 +00:00
[languages.pir]
2022-02-24 22:09:49 +00:00
title = "Cap'n Hugo Relearrrn Theme"
2024-10-07 13:30:53 +00:00
weight = 2
2024-09-29 21:57:23 +00:00
languageName = "Arrr! Pirrratish"
2021-10-24 09:53:09 +00:00
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fab fa-github' > < / i > GitHub repo"
2021-10-24 09:53:09 +00:00
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fas fa-camera' > < / i > Showcases"
2024-10-06 14:19:13 +00:00
pageRef = "/showcase"
2021-10-24 09:53:09 +00:00
weight = 11
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fas fa-bookmark' > < / i > Cap'n Hugo Documentat'n"
2021-10-24 09:53:09 +00:00
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fas fa-bullhorn' > < / i > Crrredits"
2024-10-06 14:19:13 +00:00
pageRef = "/more/credits"
2021-10-24 09:53:09 +00:00
weight = 30
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2024-03-18 16:24:06 +00:00
name = "< i class = 'fa-fw fas fa-tags' > < / i > Arrr! Tags"
2024-10-06 14:19:13 +00:00
pageRef = "/tags"
2021-10-24 09:53:09 +00:00
weight = 40
2024-03-02 10:04:52 +00:00
{{< / multiconfig > }}
2017-08-20 15:10:29 +00:00
2024-10-07 13:30:53 +00:00
## Displaying Pages Only in the Shortcuts Menu
2023-05-19 20:33:27 +00:00
2024-10-07 13:30:53 +00:00
To show pages only in the shortcuts menu you have two choices
2023-05-19 20:33:27 +00:00
2024-10-07 13:30:53 +00: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 20:33:27 +00:00
2024-10-06 18:37:18 +00:00
{{< multiconfig fm = true file = "content/showcase/_index.en.md" > }}
2023-09-21 15:23:41 +00:00
title = "Showcase"
2023-05-19 20:33:27 +00:00
[_build]
2023-09-21 15:23:41 +00:00
render = "always"
2023-05-19 20:33:27 +00:00
list = "never"
2023-09-21 15:23:41 +00:00
publishResources = true
2024-03-02 10:04:52 +00:00
{{< / multiconfig > }}
2023-05-19 20:33:27 +00:00
2024-10-07 13:30:53 +00: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 20:33:27 +00:00
2024-10-06 18:37:18 +00:00
{{< multiconfig fm = true file = "content/more/_index.en.md" > }}
2023-05-19 20:33:27 +00:00
[_build]
2023-09-21 15:23:41 +00:00
render = "never"
2023-05-19 20:33:27 +00:00
list = "never"
2023-09-21 15:23:41 +00:00
publishResources = false
2024-03-02 10:04:52 +00:00
{{< / multiconfig > }}
2023-09-21 15:23:41 +00:00
2024-10-07 13:30:53 +00:00
The child page can be any type of content.
2023-09-21 15:23:41 +00:00
2024-10-06 18:37:18 +00:00
{{< multiconfig fm = true file = "content/more/credits_index.en.md" > }}
2023-09-21 15:23:41 +00:00
title = "Credits"
2024-03-02 10:04:52 +00:00
{{< / multiconfig > }}