2021-08-25 11:33:29 +00:00
+++
title = "Menu extra shortcuts"
2022-08-05 21:53:30 +00:00
weight = 5
2021-08-25 11:33:29 +00:00
+++
2017-08-20 15:10:29 +00:00
You can define additional menu entries or shortcuts in the navigation menu without any link to content.
## Basic configuration
Edit the website configuration `config.toml` and add a `[[menu.shortcuts]]` entry for each link your want to add.
Example from the current website:
2021-08-23 22:25:15 +00:00
````toml
[[menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fab fa-fw fa-github' > < / i > GitHub repo"
2021-08-23 22:25:15 +00:00
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
[[menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-camera' > < / i > Showcases"
2023-05-17 22:12:47 +00:00
url = "showcase/"
2021-08-23 22:25:15 +00:00
weight = 11
[[menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-bookmark' > < / i > Hugo Documentation"
2021-08-23 22:25:15 +00:00
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
[[menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-bullhorn' > < / i > Credits"
2022-02-18 01:13:35 +00:00
url = "more/credits/"
2021-08-23 22:25:15 +00:00
weight = 30
2021-10-24 09:53:09 +00:00
[[menu.shortcuts]]
name = "< i class = 'fas fa-fw fa-tags' > < / i > Tags"
2022-02-06 00:55:07 +00:00
url = "tags/"
2021-10-24 09:53:09 +00:00
weight = 40
2021-08-23 22:25:15 +00:00
````
2017-08-20 15:10:29 +00:00
2021-08-23 21:51:52 +00:00
By default, shortcuts are preceded by a title. This title can be disabled by setting `disableShortcutsTitle=true` .
2022-10-31 11:10:36 +00:00
However, if you want to keep the title but change its value, it can be overridden by changing your local i18n translation string configuration.
2017-08-20 15:10:29 +00:00
For example, in your local `i18n/en.toml` file, add the following content
2021-08-23 22:25:15 +00:00
````toml
[Shortcuts-Title]
other = "< Your value > "
````
2017-08-20 15:10:29 +00:00
Read more about [hugo menu ](https://gohugo.io/extras/menus/ ) and [hugo i18n translation strings ](https://gohugo.io/content-management/multilingual/#translation-of-strings )
## Configuration for Multilingual mode {#i18n}
2021-08-23 21:51:52 +00:00
When using a multilingual website, you can set different menus for each language. In the `config.toml` file, prefix your menu configuration by `Languages.<language-id>` .
2017-08-20 15:10:29 +00:00
Example from the current website:
2021-08-23 22:25:15 +00:00
````toml
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.params]
landingPageName = "< i class = 'fas fa-home' > < / i > Home"
2021-10-24 09:53:09 +00:00
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fab fa-fw fa-github' > < / i > GitHub repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-camera' > < / i > Showcases"
2023-05-17 22:12:47 +00:00
url = "showcase/"
2021-10-24 09:53:09 +00:00
weight = 11
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-bookmark' > < / i > Hugo Documentation"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-bullhorn' > < / i > Credits"
2022-02-18 01:13:35 +00:00
url = "more/credits/"
2021-10-24 09:53:09 +00:00
weight = 30
2023-05-17 18:58:37 +00:00
[[languages.en.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-tags' > < / i > Tags"
2022-02-06 00:55:07 +00:00
url = "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"
2021-10-24 09:53:09 +00:00
weight = 1
languageName = "Arrr! Pirrrates"
2023-05-17 18:58:37 +00:00
[languages.pir.params]
landingPageName = "< i class = 'fas fa-home' > < / i > Arrr! Home"
2021-10-24 09:53:09 +00:00
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fab fa-fw fa-github' > < / i > GitHub repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-camera' > < / i > Showcases"
2023-05-17 22:12:47 +00:00
url = "showcase/"
2021-10-24 09:53:09 +00:00
weight = 11
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-bookmark' > < / i > Cap'n Hugo Documentat'n"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-bullhorn' > < / i > Crrredits"
2022-02-18 01:13:35 +00:00
url = "more/credits/"
2021-10-24 09:53:09 +00:00
weight = 30
2023-05-17 18:58:37 +00:00
[[languages.pir.menu.shortcuts]]
2021-10-24 09:53:09 +00:00
name = "< i class = 'fas fa-fw fa-tags' > < / i > Arrr! Tags"
2022-02-06 00:55:07 +00:00
url = "tags/"
2021-10-24 09:53:09 +00:00
weight = 40
2021-08-23 22:25:15 +00:00
````
2017-08-20 15:10:29 +00:00
2023-05-19 20:33:27 +00:00
Read more about [hugo menu ](https://gohugo.io/extras/menus/ ) and [hugo multilingual menus ](https://gohugo.io/content-management/multilingual/#menus )
## Shortcuts to pages inside of your project
If you have shortcuts to pages inside of your project and you don't want them to show up in page menu section, you have two choices:
1. Make the page file for the shortcut section a [headless branch bundle ](https://gohugo.io/content-management/age-bundles/#headless-bundle ) (contained in its own subdirectory and called `_index.md` ) and add the following rontmatter configuration to the file (see exampleSite's `content/showcase` ). This causes its content to **not** be ontained in the sitemap.
````toml
[_build]
render = "never"
list = "never"
publishResources = false
````
2. Store the page file for the shortcut section below a parent headless branch bundle and add the following frontmatter to he **parent** . In this case, the file itself can be a branch bundle, leaf bundle or simple page (see exampleSite's content/more/` and `content/more/credits` ). This causes its content to be contained in the sitemap.
````toml
[_build]
render = "always"
list = "never"
publishResources = true
````