Sidebar
Width
Changing the width of the sidebar
Header & Footer
Configure the header and footer
Search
Configure search and the search form
Shortcut Menu
Add additional shortcut links to the sidebar
Changing the width of the sidebar
Configure the header and footer
Configure search and the search form
Add additional shortcut links to the sidebar
The theme adjusts the menu width based on browser size.
If you want to change the chosen default width, you can add CSS variables to layouts/partials/custom-header.html
.
The menu width changes for different screen sizes:
Screen Size | Screen Width | Menu Width |
---|---|---|
Small | < 48rem | 14.375rem |
Medium | 48rem - 60rem | 14.375rem |
Large | >= 60rem | 18.75rem |
You can change the menu width but not the screen width breakpoints.
To adjust the menu width, use these CSS variables. Note that --MENU-WIDTH-S
is for the mobile menu flyout on small screens.
<style>
:root {
--MENU-WIDTH-S: 14.375rem;
--MENU-WIDTH-M: 14.375rem;
--MENU-WIDTH-L: 18.75rem;
}
</style>
Option With the default partials for the logo, The site title will also be used for the text at the top of the sidebar. If you want to show a different text in the sidebar, you can overwrite linkTitle
.
[params]
linkTitle = 'Relearn'
params:
linkTitle: Relearn
{
"params": {
"linkTitle": "Relearn"
}
}
By default, the theme displays a home button between search form and navigation menu. The Home button serves as an alternative to clicking the logo.
Option To hide the Home button on the left menu, set disableLandingPageButton=true
.
[params]
disableLandingPageButton = true
params:
disableLandingPageButton: true
{
"params": {
"disableLandingPageButton": true
}
}
Option To change its icon or text, configure the landingPageName
for your defined languages.
[languages]
[languages.en]
[languages.en.params]
landingPageName = '<i class="fa-fw fas fa-home"></i> Home'
[languages.pir]
[languages.pir.params]
landingPageName = '<i class="fa-fw fas fa-home"></i> Arrr! Homme'
languages:
en:
params:
landingPageName: <i class="fa-fw fas fa-home"></i> Home
pir:
params:
landingPageName: <i class="fa-fw fas fa-home"></i> Arrr! Homme
{
"languages": {
"en": {
"params": {
"landingPageName": "\u003ci class=\"fa-fw fas fa-home\"\u003e\u003c/i\u003e Home"
}
},
"pir": {
"params": {
"landingPageName": "\u003ci class=\"fa-fw fas fa-home\"\u003e\u003c/i\u003e Arrr! Homme"
}
}
}
}
If this option isn’t set for a specific language, it will use these default values
[params]
landingPageName = '<i class="fa-fw fas fa-home"></i> Home'
params:
landingPageName: <i class="fa-fw fas fa-home"></i> Home
{
"params": {
"landingPageName": "\u003ci class=\"fa-fw fas fa-home\"\u003e\u003c/i\u003e Home"
}
}
Option Turn on showVisitedLinks=true
to see checkmarks next to visited pages in the main menu. This also adds a Clear History
option at the bottom of the menu to remove all checkmarks. Note that checkmarks will disappear if you rebuild your site, as the page IDs may change.
[params]
showVisitedLinks = true
params:
showVisitedLinks: true
{
"params": {
"showVisitedLinks": true
}
}
To change the menu footer, edit the layouts/partials/menu-footer.html
file. Check out the Partials section for more ways to customize your site.
The theme offers three levels of search through the menu’s search form:
Each level requires the previous one to be enabled. If no search is configured, the search form won’t appear.
Option All levels are enabled by default. Disable them in hugo.toml
:
disableSearch=true
disableSearchIndex=true
disableSearchPage=true
[params]
disableSearch = true
disableSearchIndex = true
disableSearchPage = true
params:
disableSearch: true
disableSearchIndex: true
disableSearchPage: true
{
"params": {
"disableSearch": true,
"disableSearchIndex": true,
"disableSearchPage": true
}
}
Option Default URLs can be changed with the following parameter
searchindex.js
set by searchIndexURL
search/index.html
set by searchPageURL
[params]
searchIndexURL = 'omnisearchindex.js'
searchPageURL = 'omnisearch'
params:
searchIndexURL: omnisearchindex.js
searchPageURL: omnisearch
{
"params": {
"searchIndexURL": "omnisearchindex.js",
"searchPageURL": "omnisearch"
}
}
Only change these if you have content at those URLs. This can happen with uglyURLs=true
in hugo.toml
and having a content file at content/search.md
.
Check for duplicate URLs by running hugo --printPathWarnings
.
The Lunr search library doesn’t support all languages of the theme. Unsupported languages will show errors in the browser console. Currently unsupported are
Option In case your page’s content contains text in multiple languages (for example, you are writing a Piratish documentation for your English API), you can set those languages in additionalContentLanguage
to broaden the search.
[params]
additionalContentLanguage = ['en']
params:
additionalContentLanguage:
- en
{
"params": {
"additionalContentLanguage": [
"en"
]
}
}
You can add multiple languages to this array.
Use the base language code. For example, if your page is using zh-CN
, add zh
to this parameter.
The sidebar contains your content’s navigation menu, but you can also add extra menu entries or shortcuts in a separate section.
For internal links, use the pageRef
property instead of url
. Learn more about Hugo’s menu configuration.
Option By default, the shortcut menu has a title ("More" in English).
You can disable this title with disableShortcutsTitle=true
.
[params]
disableShortcutsTitle = true
params:
disableShortcutsTitle: true
{
"params": {
"disableShortcutsTitle": true
}
}
To change the title, update your local i18n translation file.
[shortcuts-menuTitle]
other = "Other Great Stuff"
Edit hugo.toml
and add [[menu.shortcuts]]
entries for each link:
[menu]
[[menu.shortcuts]]
name = 'GitHub Repo'
pre = '<i class="fa-fw fab fa-github"></i> '
url = 'https://github.com/McShelby/hugo-theme-relearn'
weight = 10
[[menu.shortcuts]]
name = 'Showcases'
pageRef = '/showcase'
weight = 20
[[menu.shortcuts]]
name = 'Credits'
pageRef = '/more/credits'
weight = 30
[[menu.shortcuts]]
name = 'Tags'
pageRef = '/tags'
pre = '<i class="fa-fw fas fa-tags"></i> '
weight = 40
[[menu.shortcuts]]
name = 'Categories'
pageRef = '/categories'
pre = '<i class="fa-fw fas fa-layer-group"></i> '
weight = 50
menu:
shortcuts:
- name: GitHub Repo
pre: '<i class="fa-fw fab fa-github"></i> '
url: https://github.com/McShelby/hugo-theme-relearn
weight: 10
- name: Showcases
pageRef: /showcase
weight: 20
- name: Credits
pageRef: /more/credits
weight: 30
- name: Tags
pageRef: /tags
pre: '<i class="fa-fw fas fa-tags"></i> '
weight: 40
- name: Categories
pageRef: /categories
pre: '<i class="fa-fw fas fa-layer-group"></i> '
weight: 50
{
"menu": {
"shortcuts": [
{
"name": "GitHub Repo",
"pre": "\u003ci class=\"fa-fw fab fa-github\"\u003e\u003c/i\u003e ",
"url": "https://github.com/McShelby/hugo-theme-relearn",
"weight": 10
},
{
"name": "Showcases",
"pageRef": "/showcase",
"weight": 20
},
{
"name": "Credits",
"pageRef": "/more/credits",
"weight": 30
},
{
"name": "Tags",
"pageRef": "/tags",
"pre": "\u003ci class=\"fa-fw fas fa-tags\"\u003e\u003c/i\u003e ",
"weight": 40
},
{
"name": "Categories",
"pageRef": "/categories",
"pre": "\u003ci class=\"fa-fw fas fa-layer-group\"\u003e\u003c/i\u003e ",
"weight": 50
}
]
}
}
For multilingual sites, set different menus for each language in hugo.toml
:
[languages]
[languages.en]
languageName = 'English'
title = 'Hugo Relearn Theme'
weight = 1
[languages.en.menu]
[[languages.en.menu.shortcuts]]
name = 'GitHub Repo'
pre = '<i class="fa-fw fab fa-github"></i> '
url = 'https://github.com/McShelby/hugo-theme-relearn'
weight = 10
[[languages.en.menu.shortcuts]]
name = 'Showcases'
pageRef = '/showcase'
weight = 20
[[languages.en.menu.shortcuts]]
name = 'Credits'
pageRef = '/more/credits'
weight = 30
[[languages.en.menu.shortcuts]]
name = 'Tags'
pageRef = '/tags'
pre = '<i class="fa-fw fas fa-tags"></i> '
weight = 40
[[languages.en.menu.shortcuts]]
name = 'Categories'
pageRef = '/categories'
pre = '<i class="fa-fw fas fa-layer-group"></i> '
weight = 50
[languages.pir]
languageName = 'Arrr! Pirrratish'
title = 'Captain Hugo Relearrrn Theme'
weight = 2
[languages.pir.menu]
[[languages.pir.menu.shortcuts]]
identifier = 'ds'
name = '<i class="fa-fw fab fa-github"></i> GitHub Repo'
url = 'https://github.com/McShelby/hugo-theme-relearn'
weight = 10
[[languages.pir.menu.shortcuts]]
name = '<i class="fa-fw fas fa-camera"></i> Showcases'
pageRef = '/showcase'
weight = 11
[[languages.pir.menu.shortcuts]]
name = 'GitHub Repo'
pre = '<i class="fa-fw fab fa-github"></i> '
url = 'https://github.com/McShelby/hugo-theme-relearn'
weight = 10
[[languages.pir.menu.shortcuts]]
name = 'Showcases'
pageRef = '/showcase'
weight = 20
[[languages.pir.menu.shortcuts]]
name = 'Crrredits'
pageRef = '/more/credits'
weight = 30
[[languages.pir.menu.shortcuts]]
name = 'Arrr! Tags'
pageRef = '/tags'
pre = '<i class="fa-fw fas fa-tags"></i> '
weight = 40
[[languages.pir.menu.shortcuts]]
name = 'Categorrries'
pageRef = '/categories'
pre = '<i class="fa-fw fas fa-layer-group"></i> '
weight = 50
languages:
en:
languageName: English
menu:
shortcuts:
- name: GitHub Repo
pre: '<i class="fa-fw fab fa-github"></i> '
url: https://github.com/McShelby/hugo-theme-relearn
weight: 10
- name: Showcases
pageRef: /showcase
weight: 20
- name: Credits
pageRef: /more/credits
weight: 30
- name: Tags
pageRef: /tags
pre: '<i class="fa-fw fas fa-tags"></i> '
weight: 40
- name: Categories
pageRef: /categories
pre: '<i class="fa-fw fas fa-layer-group"></i> '
weight: 50
title: Hugo Relearn Theme
weight: 1
pir:
languageName: Arrr! Pirrratish
menu:
shortcuts:
- identifier: ds
name: <i class="fa-fw fab fa-github"></i> GitHub Repo
url: https://github.com/McShelby/hugo-theme-relearn
weight: 10
- name: <i class="fa-fw fas fa-camera"></i> Showcases
pageRef: /showcase
weight: 11
- name: GitHub Repo
pre: '<i class="fa-fw fab fa-github"></i> '
url: https://github.com/McShelby/hugo-theme-relearn
weight: 10
- name: Showcases
pageRef: /showcase
weight: 20
- name: Crrredits
pageRef: /more/credits
weight: 30
- name: Arrr! Tags
pageRef: /tags
pre: '<i class="fa-fw fas fa-tags"></i> '
weight: 40
- name: Categorrries
pageRef: /categories
pre: '<i class="fa-fw fas fa-layer-group"></i> '
weight: 50
title: Captain Hugo Relearrrn Theme
weight: 2
{
"languages": {
"en": {
"languageName": "English",
"menu": {
"shortcuts": [
{
"name": "GitHub Repo",
"pre": "\u003ci class=\"fa-fw fab fa-github\"\u003e\u003c/i\u003e ",
"url": "https://github.com/McShelby/hugo-theme-relearn",
"weight": 10
},
{
"name": "Showcases",
"pageRef": "/showcase",
"weight": 20
},
{
"name": "Credits",
"pageRef": "/more/credits",
"weight": 30
},
{
"name": "Tags",
"pageRef": "/tags",
"pre": "\u003ci class=\"fa-fw fas fa-tags\"\u003e\u003c/i\u003e ",
"weight": 40
},
{
"name": "Categories",
"pageRef": "/categories",
"pre": "\u003ci class=\"fa-fw fas fa-layer-group\"\u003e\u003c/i\u003e ",
"weight": 50
}
]
},
"title": "Hugo Relearn Theme",
"weight": 1
},
"pir": {
"languageName": "Arrr! Pirrratish",
"menu": {
"shortcuts": [
{
"identifier": "ds",
"name": "\u003ci class=\"fa-fw fab fa-github\"\u003e\u003c/i\u003e GitHub Repo",
"url": "https://github.com/McShelby/hugo-theme-relearn",
"weight": 10
},
{
"name": "\u003ci class=\"fa-fw fas fa-camera\"\u003e\u003c/i\u003e Showcases",
"pageRef": "/showcase",
"weight": 11
},
{
"name": "GitHub Repo",
"pre": "\u003ci class=\"fa-fw fab fa-github\"\u003e\u003c/i\u003e ",
"url": "https://github.com/McShelby/hugo-theme-relearn",
"weight": 10
},
{
"name": "Showcases",
"pageRef": "/showcase",
"weight": 20
},
{
"name": "Crrredits",
"pageRef": "/more/credits",
"weight": 30
},
{
"name": "Arrr! Tags",
"pageRef": "/tags",
"pre": "\u003ci class=\"fa-fw fas fa-tags\"\u003e\u003c/i\u003e ",
"weight": 40
},
{
"name": "Categorrries",
"pageRef": "/categories",
"pre": "\u003ci class=\"fa-fw fas fa-layer-group\"\u003e\u003c/i\u003e ",
"weight": 50
}
]
},
"title": "Captain Hugo Relearrrn Theme",
"weight": 2
}
}
}
To show pages only in the shortcuts menu you have two choices
Create a headless branch bundle, _index.md
in its own folder with the below front matter. The branch bundle will not be contained in the 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"
}
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.
+++
[_build]
list = 'never'
publishResources = false
render = 'never'
+++
---
_build:
list: never
publishResources: false
render: never
---
{
"_build": {
"list": "never",
"publishResources": false,
"render": "never"
}
}
The child page can be any type of content.
+++
title = 'Credits'
+++
---
title: Credits
---
{
"title": "Credits"
}