2021-08-25 11:33:29 +00:00
+++
2024-10-12 17:28:28 +00:00
categories = ["howto"]
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-10-12 16:44:36 +00:00
weight = 4
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-12 16:37:59 +00:00
name = '< i class = "fa-fw fab fa-github" > < / i > GitHub Repo'
identifier = 'ds'
url = 'https://github.com/McShelby/hugo-theme-relearn'
2024-10-06 14:19:13 +00:00
weight = 10
2021-08-23 22:25:15 +00:00
[[menu.shortcuts]]
2024-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-camera" > < / i > Showcases'
pageRef = '/showcase'
2024-10-06 14:19:13 +00:00
weight = 11
2021-08-23 22:25:15 +00:00
[[menu.shortcuts]]
2024-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-bookmark" > < / i > Hugo Documentation'
identifier = 'hugodoc'
url = 'https://gohugo.io/'
2024-10-06 14:19:13 +00:00
weight = 20
2021-08-23 22:25:15 +00:00
[[menu.shortcuts]]
2024-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-bullhorn" > < / i > Credits'
pageRef = '/more/credits'
2024-10-06 14:19:13 +00:00
weight = 30
2021-10-24 09:53:09 +00:00
[[menu.shortcuts]]
2024-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-tags" > < / i > Tags'
pageRef = '/tags'
2024-10-06 14:19:13 +00:00
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]
2024-10-12 16:37:59 +00:00
title = 'Hugo Relearn Theme'
2021-10-24 09:53:09 +00:00
weight = 1
2024-10-12 16:37:59 +00:00
languageName = 'English'
2021-10-24 09:53:09 +00:00
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2024-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fab fa-github" > < / i > GitHub Repo'
identifier = 'ds'
url = 'https://github.com/McShelby/hugo-theme-relearn'
2021-10-24 09:53:09 +00:00
weight = 10
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2024-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-camera" > < / i > Showcases'
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-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-bookmark" > < / i > Hugo Documentation'
identifier = 'hugodoc'
url = 'https://gohugo.io/'
2021-10-24 09:53:09 +00:00
weight = 20
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2024-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-bullhorn" > < / i > Credits'
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-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-tags" > < / i > Tags'
pageRef = '/tags'
2021-10-24 09:53:09 +00:00
weight = 40
2023-05-17 18:58:37 +00:00
[languages.pir]
2024-10-12 16:37:59 +00:00
title = 'Captain Hugo Relearrrn Theme'
2024-10-07 13:30:53 +00:00
weight = 2
2024-10-12 16:37:59 +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-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fab fa-github" > < / i > GitHub Repo'
identifier = 'ds'
url = 'https://github.com/McShelby/hugo-theme-relearn'
2021-10-24 09:53:09 +00:00
weight = 10
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2024-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-camera" > < / i > Showcases'
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-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-bookmark" > < / i > Captain Hugo Documentation'
identifier = 'hugodoc'
url = 'https://gohugo.io/'
2021-10-24 09:53:09 +00:00
weight = 20
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2024-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-bullhorn" > < / i > Crrredits'
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-10-12 16:37:59 +00:00
name = '< i class = "fa-fw fas fa-tags" > < / i > Arrr! Tags'
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" > }}
2024-10-12 16:37:59 +00:00
title = 'Showcase'
2023-05-19 20:33:27 +00:00
[_build]
2024-10-12 16:37:59 +00:00
render = 'always'
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]
2024-10-12 16:37:59 +00:00
render = 'never'
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" > }}
2024-10-12 16:37:59 +00:00
title = 'Credits'
2024-03-02 10:04:52 +00:00
{{< / multiconfig > }}