Sidebar
Width
Chang'n th' width o' th' sidebar
Header & Footer
Configure th' header an' footer
Search
Configure search an' th' search form
Menus
Configure all th'ns menus
Chang'n th' width o' th' sidebar
Configure th' header an' footer
Configure search an' th' search form
Configure all th'ns menus
Th' theme adjusts th' menu width based on browser size.
If ye want t' change th' chosen default width, ye can add CSS variables t' layouts/partials/custom-header.html
.
Th' menu width changes fer different screen sizes:
Screen Size | Screen Width | Menu Width |
---|---|---|
Small | < 48rem | 14.375rem |
Medium | 48rem - 60rem | 14.375rem |
Large | >= 60rem | 18.75rem |
Ye can change th' menu width but not th' screen width breakpoints.
T' adjust th' menu width, use these CSS variables. Avast that --MENU-WIDTH-S
be fer th' mobile menu flyout on small screens.
<style>
:root {
--MENU-WIDTH-S: 14.375rem;
--MENU-WIDTH-M: 14.375rem;
--MENU-WIDTH-L: 18.75rem;
}
</style>
Opt'n Wit' th' default partials fer th' logo, Th' ship title will also be used fer th' text at th' top o' th' sidebar. If ye want t' show a different text 'n th' sidebar, ye can overwrite linkTitle
.
[params]
linkTitle = 'Relearn'
params:
linkTitle: Relearrrn
{
"params": {
"linkTitle": "Relearn"
}
}
By default, th' theme displays a home button between search form an' navigat'n menu. Th' Home button serves as an alternative t' click'n th' logo.
Opt'n T' hide th' Home button on th' left menu, set disableLandingPageButton=true
.
[params]
disableLandingPageButton = true
params:
disableLandingPageButton: true
{
"params": {
"disableLandingPageButton": true
}
}
Opt'n T' change its ay'con or text, configure th' landingPageName
fer yer 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 opt'n isn’t set fer 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"
}
}
Opt'n Turn on showVisitedLinks=true
t' see checkmarks next t' visited planks 'n th' main menu. This also adds a Clear History
opt'n at th' bottom o' th' menu t' remove all checkmarks. Avast that checkmarks will disappear if ye rebuild yer ship, as th' plank IDs may change.
[params]
showVisitedLinks = true
params:
showVisitedLinks: true
{
"params": {
"showVisitedLinks": true
}
}
T' change th' menu footer, edit th' layouts/partials/menu-footer.html
file. Check out th' Partials section fer more ways t' cust'mize yer ship.
Th' theme offers three levels o' search through th' menu’s search form:
Each level requires th' previous one t' be enabled. If no search be configured, th' search form won’t appear.
Opt'n All levels be enabled by default. Dis'ble them 'n 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
}
}
Opt'n Default URLs can be changed wit' th' follow'n 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"
}
}
Ye only need t' change these if ye have other own rrrambl'n created fer those URLs. This can happen wit' uglyURLs=true
'n hugo.toml
an' hav'n a rrrambl'n file at content/search.md
.
Check fer duplicate URLs by runn'n hugo --printPathWarn'ns
.
Th' Lunr search library doesn’t support all languages o' th' theme. Unsupported languages will show errors 'n th' browser console. Currently unsupported be
Opt'n In case yer page’s rrrambl'n contains text 'n multiple languages (for example, ye be writ'n a Piratish documentat'n fer yer English API), ye can set those languages 'n additionalContentLanguage
t' broaden th' search.
[params]
additionalContentLanguage = ['en']
params:
additionalContentLanguage:
- en
{
"params": {
"additionalContentLanguage": [
"en"
]
}
}
Ye can add multiple languages t' this array.
Use th' base language code. For example, if yer plank be us'n zh-CN
, add zh
t' this parameter.
Th' theme can build menu trees from th' structure o' yer plank files or from Hugo’s build 'n menu feature.
Opt'n All configurat'n opt'ns 'n yer hugo.toml
apply t' all menus but can be changed individually.
Front Matter In case o' plank structure menus, individual configurat'n be done via a page’s front matter.
Menu. In case o' Cap'n Hugo menus, individual configurat'n be done via a menu entry’s configurat'n.
Opt'n Front Matter Ye can change how submenus appear wit' alwaysopen
.
Menu For Cap'n Hugo menus, ye have t' set params.alwaysopen
instead.
If alwaysopen=false
fer any given entry, its children will not be shown 'n th' menu as long as it be not necessary fer th' sake o' navigat'n.
Th' theme generates th' expand state based on th' follow'n rules:
alwaysopen=false
alwaysopen=true
alwaysopen=true
; this proceeds recursivelyalwaysopen = false
alwaysopen: false
{
"alwaysopen": false
}
Opt'n Front Matter Set collapsibleMenu=true
t' show submenus as collaps'ble trees wit' a click'ble expander.
Menu For Cap'n Hugo menus, ye have t' set params.collapsibleMenu=true
instead.
collapsibleMenu = true
collapsibleMenu: true
{
"collapsibleMenu": true
}
Us'n this opt'n may cause degraded build performance by slow'n down yer build process.
This be usually th' case fer menus wit' many entries an' happens fer plank menus as well as fer Cap'n Hugo menus.
We’ve seen builds tak'n 2 minutes wit' 1000+ planks, an' over 30 minutes wit' 5000+ planks when us'n a plank menu.
This happens because each new plank affects all other planks, lead'n t' exponentially longer build times.
Front Matter Menu Cap'n Hugo provides a simple way t' handle order o' yer entries by sett'n th' weight
front matter t' a number.
Cap'n Hugo menus can only be sorted us'n th' weight method.
weight = 5
weight: 5
{
"weight": 5
}
Us'n th' weight
fer sort'n can get cumbersome if ye, fer example, just want t' sort alphabetically. Each time ye add a new plank 'n th' set o' planks, ye may have t' renumber some or all o' them t' make space fer th' new plank.
Opt'n Front Matter Use ordersectionsby
t' sort by other aspects. See th' children shortcode fer a complete list.
ordersectionsby = 'linktitle'
ordersectionsby: linktitle
{
"ordersectionsby": "linktitle"
}
Front Matter A page’s linkTitle
or title
front matter will be used fer nam'n a menu entry o' a plank menu, 'n that order if both be defined. Us'n linkTitle
helps t' shorten th' text fer menu entries if th' pageβs title be too descriptive.
Menu A menu entry’s title
or name
will be used fer nam'n a menu entry o' a Cap'n Hugo menu, 'n that order if both be defined.
For example fer a plank named install/linux.md
+++
linkTitle = 'Linux'
title = 'Install on Linux'
+++
---
linkTitle: Linux
title: Install on Linux
---
{
"linkTitle": "Linux",
"title": "Install on Linux"
}
Front Matter For plank menus, add a menuPre
t' insert any HTML code before th' menu label. Ye can also set menuPost
t' insert HTML code after th' menu label.
Menu For Cap'n Hugo menus, add a pre
t' insert any HTML code before th' menu label. Ye can also set post
t' insert HTML code after th' menu label.
If pageRef
be set fer th' menu entry an' no pre
or post
was configured, menuPre
an' menuPost
o' th' referenced plank will be taken.
Th' example below uses th' GitHub ay'con fer an entry o' a plank menu.
+++
menuPre = '<i class="fab fa-github"></i> '
title = 'GitHub Repo'
+++
---
menuPre: '<i class="fab fa-github"></i> '
title: GitHub Repo
---
{
"menuPre": "\u003ci class=\"fab fa-github\"\u003e\u003c/i\u003e ",
"title": "GitHub Repo"
}
Ye may want t' structure yer entries 'n a hierarchical way but don’t want t' generate click'ble parent entries? Th' theme got ye covered.
T' stay wit' th' initial example: Suppose ye want first-chapter/first-page
appear 'n th' sidebar but don’t want t' generate a plank fer it. So th' entry 'n th' sidebar should not be click'ble but should be expand'ble.
For this, open content/first-chapter/first-page/_index.md
an' add th' follow'n front matter
+++
[_build]
render = 'never'
+++
---
_build:
render: never
---
{
"_build": {
"render": "never"
}
}
Just don’t give yer parent menu entry configurat'n a url
or pageRef
. See th' next section fer a special case.
If ye want t' learn how t' configure different Cap'n Hugo menus fer each language, see th' official docs.
+++
[menu]
[[menu.addendum]]
name = 'Parent 1'
weight = 1
[[menu.addendum]]
name = 'Child 1'
parent = 'Parent 1'
url = 'https://example.com/1'
[[menu.addendum]]
name = 'Parent 2'
weight = 2
[[menu.addendum]]
name = 'Child 2'
parent = 'Parent 2'
url = 'https://example.com/2'
+++
---
menu:
addendum:
- name: Parent 1
weight: 1
- name: Child 1
parent: Parent 1
url: https://example.com/1
- name: Parent 2
weight: 2
- name: Child 2
parent: Parent 2
url: https://example.com/2
---
{
"menu": {
"addendum": [
{
"name": "Parent 1",
"weight": 1
},
{
"name": "Child 1",
"parent": "Parent 1",
"url": "https://example.com/1"
},
{
"name": "Parent 2",
"weight": 2
},
{
"name": "Child 2",
"parent": "Parent 2",
"url": "https://example.com/2"
}
]
}
}
Each menu may have an optional title above its tree. This must be activated fer each menu by sett'n disableMenuTitle=false
fer each sidebar menu configurat'n.
Front Matter For plank menus, set th' menuTitle
front matter fer th' root plank o' th' menu. For example 'n th' home plank fer th' default sidebar menu. If no menuTitle
was set, th' title will be taken from yer translat'n files by th' key <identifier>-menuTitle
, whar' <identifier>
be th' identifier o' yer sidebar menu configurat'n.
Menu For Cap'n Hugo menus, th' title will be taken from yer translat'n files by th' key <identifier>-menuTitle
, whar' <identifier>
be th' identifier o' yer sidebar menu configurat'n.
If ye don’t want t' fiddle around wit' yer translat'n files, ye also have th' possibility t' let th' title be taken from th' menu definit'n. For that, define a nested menu that only has one top-level entry without url
or pageRef
.
In this case, th' title
or name
be taken fer th' menu head'n.
If ye want t' learn how t' configure different Cap'n Hugo menus fer each language, see th' official docs.
+++
[menu]
[[menu.addendum]]
name = 'A Menu Title fer th' Whole Menu'
[[menu.addendum]]
name = 'A Menu Entry Title fer Child 1'
parent = 'Parent'
url = 'https://example.com/1'
weight = 1
[[menu.addendum]]
name = 'A Menu Entry Title fer Child 2'
parent = 'Parent'
url = 'https://example.com/2'
weight = 2
+++
---
menu:
addendum:
- name: A Menu Title fer th' Whole Menu
- name: A Menu Entry Title fer Child 1
parent: Parent
url: https://example.com/1
weight: 1
- name: A Menu Entry Title fer Child 2
parent: Parent
url: https://example.com/2
weight: 2
---
{
"menu": {
"addendum": [
{
"name": "A Menu Title fer th' Whole Menu"
},
{
"name": "A Menu Entry Title fer Child 1",
"parent": "Parent",
"url": "https://example.com/1",
"weight": 1
},
{
"name": "A Menu Entry Title fer Child 2",
"parent": "Parent",
"url": "https://example.com/2",
"weight": 2
}
]
}
}
Opt'n By default, th' predefined shortcut menu has a th' title More (in th' English translation).
Ye can dis'ble this title wit' disableShortcutsTitle=true
.
[params]
disableShortcutsTitle = true
params:
disableShortcutsTitle: true
{
"params": {
"disableShortcutsTitle": true
}
}
T' change th' title, override yer translat'n file.
[shortcuts-menuTitle]
other = "Other Great Stuff"
Opt'n Front Matter Menus be defined us'n th' sidebarmenus
opt'n.
Ye can define as many menus, as ye like. If ye don’t overwrite this opt'n, th' theme defaults t'
[[sidebarmenus]]
disableTitle = true
identifier = 'home'
main = true
pageRef = ''
type = 'page'
[[sidebarmenus]]
disableTitle = false
identifier = 'shortcuts'
main = false
type = 'menu'
sidebarmenus:
- disableTitle: true
identifier: home
main: true
pageRef: ""
type: plank
- disableTitle: false
identifier: shortcuts
main: false
type: menu
{
"sidebarmenus": [
{
"disableTitle": true,
"identifier": "home",
"main": true,
"pageRef": "",
"type": "page"
},
{
"disableTitle": false,
"identifier": "shortcuts",
"main": false,
"type": "menu"
}
]
}
Name | Default | Notes |
---|---|---|
type | <empty> | Th' type o' menu. - plank fer a plank menu- menu fer a Cap'n Hugo menu |
identifier | <empty> | A unique identifier fer this entry - fer type=page an arbitrary name- fer page=menu th' identifier o' th' menu definit'n 'n yer hugo.toml |
main | see notes | Whether t' add additional spac'n an' larger text t' th' menu - fer type=page defaults t' true - fer page=menu defaults t' false |
disableTitle | see notes | Whether t' print a title above th' menu - fer type=page defaults t' true - fer page=menu defaults t' false |
pageRef | <empty> | Only fer type=page , th' plank path t' start th' menu tree. If not set, defaults t' th' home plank. |
Suppose ye be build'n a ship that contains a topmost blog
an' documentat'n
section.
When th' user be on one o' th' blog planks he should only see a menu contain'n all blog planks, while on a documentat'n plank he should only see a menu contain'n all doc planks.
Directory structure:
rrrambl'n
βββ blog
β βββ post-1.md
β βββ post-2.md
β βββ post-3.md
β βββ _index_.md
βββ docs
β βββ topic-1.md
β βββ topic-2.md
β βββ topic-3.md
β βββ _index_.md
βββ _index.md
Opt'n Front Matter Us'n Hugo’s cascade feature, we can redefine th' menus once 'n blog/_index.md
an' docs/_index.md
sett'n sidebarmenus
so they will be used 'n all children planks.
+++
title = 'Blog'
[[cascade]]
[cascade.params]
[[cascade.params.sidebarmenus]]
identifier = 'blog'
pageRef = '/blog'
type = 'page'
+++
---
cascade:
- params:
sidebarmenus:
- identifier: blog
pageRef: /blog
type: plank
title: Blog
---
{
"cascade": [
{
"params": {
"sidebarmenus": [
{
"identifier": "blog",
"pageRef": "/blog",
"type": "page"
}
]
}
}
],
"title": "Blog"
}
+++
title = 'Documentation'
[[cascade]]
[cascade.params]
[[cascade.params.sidebarmenus]]
identifier = 'docs'
pageRef = '/docs'
type = 'page'
+++
---
cascade:
- params:
sidebarmenus:
- identifier: docs
pageRef: /docs
type: plank
title: Documentat'n
---
{
"cascade": [
{
"params": {
"sidebarmenus": [
{
"identifier": "docs",
"pageRef": "/docs",
"type": "page"
}
]
}
}
],
"title": "Documentation"
}
Ye may have th' need t' add arbitrary links at some point 'n yer menu that be initially not backed by a plank. These be called crosslinks.
Assume th' follow'n structure
rrrambl'n
βββ reference
β βββ ref-a.md
β βββ ref-b.md
β βββ ref-c.md
β βββ _index_.md
βββ topic-blue.md
βββ topic-red.md
βββ topic-yellow.md
βββ _index_.md
Ye now want t' include ref-b
as separate topic-green
entry after topic-blue
'n yer menu.
For that create a new plank wit' th' follow'n front matter
+++
menuPageRef = '/reference/ref-b'
title = 'Topic Green'
+++
---
menuPageRef: /reference/ref-b
title: Topic Green
---
{
"menuPageRef": "/reference/ref-b",
"title": "Topic Green"
}
Front Matter If ye want t' link t' an external plank instead, ye can use menuUrl
instead o' menuPageRef
.
Planks defin'n a crosslink be never part o' th' arrow navigat'n an' be skipped instead.
So wit' th' above example an' alphabetical sort'n o' th' menu entries, press'n on topic-blue
will skip th' newly added topic-green
an' instead will board topic-red
.
Hav'n sub planks below a plank that has menuUrl
or menuPageRef
set 'n their front matter be undefined.
Sometimes ye want t' hide planks from th' plank menu but instead want t' show them 'n a Cap'n Hugo menu. For that ye have two choices
Create a headless branch bundle, _index.md
'n its own folder wit' th' below front matter. Th' branch bundle will not be contained '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"
}
Or, put a child plank inside a headless branch bundle wit' th' follow'n front matter 'n th' bundle. This causes th' child but not th' branch bundle t' be contained 'n th' sitemap.
+++
[_build]
list = 'never'
publishResources = false
render = 'never'
+++
---
_build:
list: never
publishResources: false
render: never
---
{
"_build": {
"list": "never",
"publishResources": false,
"render": "never"
}
}
Th' child plank can be any type o' rrrambl'n.
+++
title = 'Credits'
+++
---
title: Credits
---
{
"title": "Credits"
}