Menu extrrra shorrrtcuts
Ye can define additional menu entries or shortcuts 'n th' navigat'n menu without any link t' rrrambl'n.
Basic configurat'n
Edit th' website configurat'n hugo.toml
an' add a [[menu.shortcuts]]
entry fer each link yer want t' add.
Example from th' current website:
[menu]
[[menu.shortcuts]]
identifier = 'ds'
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
url = 'https://github.com/McShelby/hugo-theme-relearn'
weight = 10
[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = 'showcase/'
weight = 11
[[menu.shortcuts]]
identifier = 'hugodoc'
name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentation"
url = 'https://gohugo.io/'
weight = 20
[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
url = 'more/credits/'
weight = 30
[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-tags'></i> Tags"
url = 'tags/'
weight = 40
menu:
shortcuts:
- identifier: ds
name: <i class='fab fa-fw fa-github'></i> GitHub repo
url: https://github.com/McShelby/hugo-theme-relearn
weight: 10
- name: <i class='fas fa-fw fa-camera'></i> Showcases
url: showcase/
weight: 11
- identifier: hugodoc
name: <i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentat'n
url: https://gohugo.io/
weight: 20
- name: <i class='fas fa-fw fa-bullhorn'></i> Credits
url: more/credits/
weight: 30
- name: <i class='fas fa-fw fa-tags'></i> Tags
url: tags/
weight: 40
{
"menu": {
"shortcuts": [
{
"identifier": "ds",
"name": "\u003ci class='fab fa-fw fa-github'\u003e\u003c/i\u003e GitHub repo",
"url": "https://github.com/McShelby/hugo-theme-relearn",
"weight": 10
},
{
"name": "\u003ci class='fas fa-fw fa-camera'\u003e\u003c/i\u003e Showcases",
"url": "showcase/",
"weight": 11
},
{
"identifier": "hugodoc",
"name": "\u003ci class='fas fa-fw fa-bookmark'\u003e\u003c/i\u003e Cap'n Hugo Documentation",
"url": "https://gohugo.io/",
"weight": 20
},
{
"name": "\u003ci class='fas fa-fw fa-bullhorn'\u003e\u003c/i\u003e Credits",
"url": "more/credits/",
"weight": 30
},
{
"name": "\u003ci class='fas fa-fw fa-tags'\u003e\u003c/i\u003e Tags",
"url": "tags/",
"weight": 40
}
]
}
}
By default, shortcuts be preceded by a title. This title can be disabled by sett'n disableShortcutsTitle=true
.
However, if ye want t' keep th' title but change its value, it can be overridden by chang'n yer local i18n translat'n str'n configurat'n.
For example, 'n yer local i18n/en.toml
file, add th' follow'n rrrambl'n
[Shortcuts-Title]
other = "<Your value>"
Read more about hugo menu an' hugo i18n translat'n str'ns
Configurat'n fer Multilingual mode
When us'n a multilingual website, ye can set different menus fer each language. In th' hugo.toml
file, prefix yer menu configurat'n by Languages.<language-id>
.
Example from th' current website:
[languages]
[languages.en]
languageName = 'English'
title = 'Hugo Relearrrn Theme'
weight = 1
[languages.en.menu]
[[languages.en.menu.shortcuts]]
identifier = 'ds'
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
url = 'https://github.com/McShelby/hugo-theme-relearn'
weight = 10
[[languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
pageRef = 'showcase/'
weight = 11
[[languages.en.menu.shortcuts]]
identifier = 'hugodoc'
name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentation"
url = 'https://gohugo.io/'
weight = 20
[[languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
pageRef = 'more/credits/'
weight = 30
[[languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-tags'></i> Tags"
pageRef = 'tags/'
weight = 40
[languages.en.params]
landingPageName = "<i class='fas fa-home'></i> Home"
[languages.pir]
languageName = 'Arrr! Pirrrates'
title = "Cap'n Hugo Relearrrn Theme"
weight = 1
[languages.pir.menu]
[[languages.pir.menu.shortcuts]]
identifier = 'ds'
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
url = 'https://github.com/McShelby/hugo-theme-relearn'
weight = 10
[[languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
pageRef = 'showcase/'
weight = 11
[[languages.pir.menu.shortcuts]]
identifier = 'hugodoc'
name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentat'n"
url = 'https://gohugo.io/'
weight = 20
[[languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Crrredits"
pageRef = 'more/credits/'
weight = 30
[[languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-tags'></i> Arrr! Tags"
pageRef = 'tags/'
weight = 40
[languages.pir.params]
landingPageName = "<i class='fas fa-home'></i> Arrr! Home"
languages:
en:
languageName: English
menu:
shortcuts:
- identifier: ds
name: <i class='fab fa-fw fa-github'></i> GitHub repo
url: https://github.com/McShelby/hugo-theme-relearn
weight: 10
- name: <i class='fas fa-fw fa-camera'></i> Showcases
pageRef: showcase/
weight: 11
- identifier: hugodoc
name: <i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentat'n
url: https://gohugo.io/
weight: 20
- name: <i class='fas fa-fw fa-bullhorn'></i> Credits
pageRef: more/credits/
weight: 30
- name: <i class='fas fa-fw fa-tags'></i> Tags
pageRef: tags/
weight: 40
params:
landingPageName: <i class='fas fa-home'></i> Home
title: Cap'n Hugo Relearrrn Theme
weight: 1
pir:
languageName: Arrr! Pirrrates
menu:
shortcuts:
- identifier: ds
name: <i class='fab fa-fw fa-github'></i> GitHub repo
url: https://github.com/McShelby/hugo-theme-relearn
weight: 10
- name: <i class='fas fa-fw fa-camera'></i> Showcases
pageRef: showcase/
weight: 11
- identifier: hugodoc
name: <i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentat'n
url: https://gohugo.io/
weight: 20
- name: <i class='fas fa-fw fa-bullhorn'></i> Crrredits
pageRef: more/credits/
weight: 30
- name: <i class='fas fa-fw fa-tags'></i> Arrr! Tags
pageRef: tags/
weight: 40
params:
landingPageName: <i class='fas fa-home'></i> Arrr! Home
title: Cap'n Hugo Relearrrn Theme
weight: 1
{
"languages": {
"en": {
"languageName": "English",
"menu": {
"shortcuts": [
{
"identifier": "ds",
"name": "\u003ci class='fab fa-fw fa-github'\u003e\u003c/i\u003e GitHub repo",
"url": "https://github.com/McShelby/hugo-theme-relearn",
"weight": 10
},
{
"name": "\u003ci class='fas fa-fw fa-camera'\u003e\u003c/i\u003e Showcases",
"pageRef": "showcase/",
"weight": 11
},
{
"identifier": "hugodoc",
"name": "\u003ci class='fas fa-fw fa-bookmark'\u003e\u003c/i\u003e Cap'n Hugo Documentation",
"url": "https://gohugo.io/",
"weight": 20
},
{
"name": "\u003ci class='fas fa-fw fa-bullhorn'\u003e\u003c/i\u003e Credits",
"pageRef": "more/credits/",
"weight": 30
},
{
"name": "\u003ci class='fas fa-fw fa-tags'\u003e\u003c/i\u003e Tags",
"pageRef": "tags/",
"weight": 40
}
]
},
"params": {
"landingPageName": "\u003ci class='fas fa-home'\u003e\u003c/i\u003e Home"
},
"title": "Hugo Relearrrn Theme",
"weight": 1
},
"pir": {
"languageName": "Arrr! Pirrrates",
"menu": {
"shortcuts": [
{
"identifier": "ds",
"name": "\u003ci class='fab fa-fw fa-github'\u003e\u003c/i\u003e GitHub repo",
"url": "https://github.com/McShelby/hugo-theme-relearn",
"weight": 10
},
{
"name": "\u003ci class='fas fa-fw fa-camera'\u003e\u003c/i\u003e Showcases",
"pageRef": "showcase/",
"weight": 11
},
{
"identifier": "hugodoc",
"name": "\u003ci class='fas fa-fw fa-bookmark'\u003e\u003c/i\u003e Cap'n Hugo Documentat'n",
"url": "https://gohugo.io/",
"weight": 20
},
{
"name": "\u003ci class='fas fa-fw fa-bullhorn'\u003e\u003c/i\u003e Crrredits",
"pageRef": "more/credits/",
"weight": 30
},
{
"name": "\u003ci class='fas fa-fw fa-tags'\u003e\u003c/i\u003e Arrr! Tags",
"pageRef": "tags/",
"weight": 40
}
]
},
"params": {
"landingPageName": "\u003ci class='fas fa-home'\u003e\u003c/i\u003e Arrr! Home"
},
"title": "Cap'n Hugo Relearrrn Theme",
"weight": 1
}
}
}
Read more about hugo menu an' hugo multilingual menus
Shortcuts t' planks inside o' yer project
If ye have shortcuts t' planks inside o' yer project an' ye don’t want them t' show up 'n plank menu section, ye have two choices:
-
Make th' plank file fer th' shortcut a headless branch bundle (contained 'n its own subdirectory an' called
_index.md
) an' add th' follow'n frontmatter configurat'n t' th' file (see exampleSite’scontent/showcase/_index.en.md
). This causes its rrrambl'n t' not be ontained 'n th' sitemap.+++ title = 'Showcase' [_build] list = 'never' publishResources = true render = 'always' +++
--- _build: list: never publishResources: true render: always title: Showcase ---
{ "_build": { "list": "never", "publishResources": true, "render": "always" }, "title": "Showcase" }
-
Store th' plank file fer th' shortcut below a parent headless branch bundle an' add th' follow'n frontmatter t' he parent (see exampleSite’s
content/more/_index.en.md
). _Don’t give this plank atitle
as this will cause it t' be 'n th' breadcrumbs - a th'n ye most likely don’t want.+++ [_build] list = 'never' publishResources = false render = 'never' +++
--- _build: list: never publishResources: false render: never ---
{ "_build": { "list": "never", "publishResources": false, "render": "never" } }
In this case, th' file itself can be a branch bundle, leaf bundle or simple plank (see exampleSite’s
content/more/credits.en.md
). This causes its rrrambl'n t' be contained 'n th' sitemap.+++ title = 'Credits' +++
--- title: Credits ---
{ "title": "Credits" }