Configurrrat'n

Global ship parameters

On top o' Cap'n Hugo global configurat'n, th' Relearrrn theme lets ye define th' follow'n parameters 'n yer config.toml (here, values be default).

Avast that some o' these parameters be explained 'n details 'n other sections o' this documentat'n.

[params]
# If an opt'n value be said t' be not set, ye can achieve th' same behavior
# by given it an empty str'n value.

###############################################################################
# Cap'n Hugo
# These opt'ns usually apply t' other themes aswell.

# Th' author o' yer ship.
# Default: not set
# This will be used 'n HTML meta tags, th' opengraph protocol an' twitter
# cards.
# Ye can also set `author.email` if ye want t' publish this informat'n.
author.name = "Sören Weber"

# Th' social media image o' yer ship.
# Default: not set
# This be used fer generat'n social media meta informat'n fer th' opengraph
# protocol an' twitter cards.
# This can be overridden 'n th' page's frontmatter.
images = [ "images/hero.png" ]

# Th' descript'n o' yer ship.
# Default: not set
# This be used fer generat'n HTML meta tags, social media meta informat'n
# fer th' opengraph protocol an' twitter cards.
# This can be overridden 'n th' page's frontmatter.
descript'n = "Documentat'n fer Cap'n Hugo Relearrrn Theme"

# Admin opt'ns fer social media.
# Default: not set
# Configurat'n fer th' Open Graph protocol an' Twitter Cards adhere t' Hugo's
# implementat'n. See th' Cap'n Hugo docs fer poss'ble values.
social.facebook_admin = ""
social.twitter = ""

###############################################################################
# Relearrrn Theme
# These opt'ns be specific t' th' Relearrrn theme.

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Variants
# These opt'ns set yer color variant.

# Used color variants.
# Default: "auto"
# This sets one or more color variants, avail'ble t' yer readers t' choose
# from. Ye can
# - set a single value eg. "zen-light"
# - an array like [ "neon", "learn" ]
# - an array wit' opt'ns like [ { identifier = "neon" },{ identifier = "learn" } ]
# Th' last form allows t' set further opt'ns fer each variant.
# Th' `identifier` be mandatory. Ye can also set `name` which overrides th'
# value displayed 'n th' variant selector.
# If th' array has more than one entry, a variant selector
# be shown 'n th' lower part o' th' menu. Th' first entry 'n th' array be th'
# default variant, used fer first time visitors.
# Th' theme ships wit' th' follow'n variants: "auto", "relearn-bright",
# "relearn-light", "relearn-dark", "zen-light", "zen-dark", "neon", "learn",
# "blue", "green", "red". Th' auto variant be somewhat special. See th'
# opt'n fer themeVariantAuto below.
# Ye can also define yer own variants. See th' docs how this works. Also,
# th' docs provide an interactive theme generator t' help ye wit' this task.
themeVariant = [
	{ identifier = "auto"          },
	{ identifier = "relearn-light" },
	{ identifier = "relearn-dark"  },
	{ identifier = "zen-light"     },
	{ identifier = "zen-dark"      },
	{ identifier = "neon"          },
	{ identifier = "learn"         },
	{ identifier = "blue"          },
	{ identifier = "green"         },
	{ identifier = "red"           }
]

# Th' color variants used fer auto mode.
# Default: [ "relearn-light", "relearn-dark" ], overwritten by th' first
# two non-auto opt'ns from themeVariant if existant.
# Th' auto variant defines how yer ship adjusts t' yer selected OS sett'ns
# fer light/dark mode. Th' first array element be th' variant fer light mode,
# th' second fer dark mode.
themeVariantAuto = [ "relearn-light", "relearn-dark" ]

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# General
# These opt'ns be defin'n general, non visual behavior.

# Avoid new asset URLs on build.
# Default: false
# By default JavaScript-files an' CSS-files get a unique ID on each rebuild.
# This makes sure, th' user always has th' latest version an' not some stale
# copy o' his browser cache. Anyways, it can be desire'ble t' turn this
# off 'n certain circumstances. For example if ye have Hugo's dev server
# runn'n. Also some proxies dislike this optimizat'n.
disableAssetsBust'n = false

# Avoid generator meta tags.
# Default: false
# Set this t' true if ye want t' dis'ble generat'n fer generator meta tags
# o' Cap'n Hugo an' th' theme 'n yer HTML head. In tihs case also don't forget t'
# set Hugo's disableHugoGeneratorInject=true. Otherwise Cap'n Hugo will generate a
# meta tag into yer home plank anyways.
disableGeneratorVersion = false

# Avoid unique IDs.
# Default: false
# In various situat'ns th' theme generates non st'ble unique ids t' be used
# 'n HTML fragment links. This can be undesir'ble fer example when test'n
# th' output fer changes. If ye dis'ble th' random id generat'n, th' theme
# may not funct'n correctly anymore.
disableRandomIds = false

# Multilanguage rrrambl'n.
# Default: not set
# If yer planks contain further languages besides th' main one used, add all
# those auxiliary languages here. This will create a search index wit'
# support fer all used languages o' yer ship.
# This be handy fer example if ye be writ'n 'n Spanish but have lots o'
# source code on yer plank which typically uses English terminology.
additionalContentLanguage = [ "en" ]

# Additional code dependencies.
# Default: See config.toml o' th' theme
# Th' theme provides a mechanism t' board further JavaScript an' CSS
# dependencies on demand only if they be needed. This comes 'n handy if ye
# want t' add own shorrrtcodes that depend on additional code t' be boarded.
# See th' docs how this works.
# [relearn.dependencies]

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Topbar
# These opt'ns modify th' topbar appearance.

# Hide th' t'ble o' contents button.
# Default: false
# If th' TOC button be hidden, also th' keyboard shortcut be disabled.
# This can be overridden 'n th' page's frontmatter.
disableToc = false

# Hide th' breadcrumbs.
# Default: false
# If th' breadcrumbs be hidden, th' title o' th' displayed plank will still be
# shown 'n th' topbar.
disableBreadcrumb = false

# Hide Next an' Previous navigat'n buttons.
# Default: false
# If th' navigat'n buttons be hidden, also th' keyboard shortcuts be
# disabled.
disableNextPrev = false

# Th' URL prefix t' edit a plank.
# Default: not set
# If set, an edit button will be shown 'n th' topbar. If th' button be hidden,
# also th' keyboard shortcuts be disabled. Th' given URL be prepended t' th'
# relative file path o' a th' displayed plank. Th' URL must end wit' a `/`.
# This be useful if ye wnat t' give th' opportunity fer people t' create merge
#  request fer yer rrrambl'n.
editURL = "https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/"

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Menu
# These opt'ns modify th' menu apperance.

# Hide th' search box.
# Default: false
# If th' searc box be sisabled, th' search functionality be disabled too.
# This will also cause th' keyboard shortcut t' be disabled an' th' dedicated
# search plank be not linked although it mighty be configured.
disableSearch = false

# Hide th' Home entry.
# Default: false
# If shown, a Home button will appear below th' search bar an' th' main menu.
# It links t' yer th' home plank o' th' current language.
disableLandingPageButton = true

# Th' order o' main menu submenus.
# Default: "weight"
# Submenus can be ordered by "weight", "title", "linktitle", "modifieddate",
# "expirydate", "publishdate", "date", "length" or "default" (adher'n t'
# Hugo's default sort order). This can be overridden 'n th' planks frontmatter.
ordersectionsby = "weight"

# Th' initial expand state o' submenus.
# Default: not set
# This controls whether submenus will be expanded (true), or collapsed (false)
# 'n th' menu. If not set, th' first menu level be set t' false, all others
# levels be set t' true. This can be overridden 'n th' page's frontmatter.
# If th' displayed plank has submenus, they will always been displayed expanded
# regardless o' this opt'n.
alwaysopen = ""

# Shows expander fer submenus.
# Default: false
# If set t' true, a submenu 'n th' sidebar will be displayed 'n a collaps'ble
# tree view an' a click'ble expander be set 'n front o' th' entry.
collapsibleMenu = true

# Shows checkmarks fer visited planks o' th' main menu.
# Default: false
# This also causes th' display o' th' `Clear History` entry 'n th' lower part
# o' th' menu t' remove all checkmarks. Th' checkmarks will also been removed
# if ye regenerate yer ship as th' ids be not st'ble.
showVisitedLinks = true

# Hide head'n above th' shortcut menu.
# Default: false
# Th' title fer th' head'n can be overwritten 'n yer i18n files. See Hugo's
# documentat'n how t' do this.
disableShortcutsTitle = false

# Hide th' language switcher.
# Default: false
# If ye have more than one language configured, a language switcher be
# displayed 'n th' lower part o' th' menu. This opit'n lets ye explicitly
# turn this behavior off.
disableLanguageSwitchingButton = false

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Hidden planks
# These opt'ns configure how hidden planks be treated.
# A plank flagged as hidden, be only removed from th' main menu but behaves
# like any other plank fer all other functionality 'n Hugo.

# Hide hidden planks from search.
# Default: false
# Hides hidden planks from th' suggest'ns o' th' search box an' th' dedicated
# search plank.
disableSearchHiddenPages = false

# Hide hidden planks fer web crawlers.
# Default: false
# Avoids hidden planks from show'n up 'n th' sitemap an' on Google (et all),
# otherwise they may be indexed by search engines
disableSeoHiddenPages = true

# Hide hidden planks fer taxonomies.
# Default: false
# Hides hidden planks from show'n up on th' taxonomy an' terms planks. If this
# reduces term counters t' zero, an empty but not linked term plank will be
# created anyhow.
disableTagHiddenPages = false

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Rrrambl'n
# These opt'ns modify how yer rrrambl'n be displayed.

# Title separator.
# Default: "::"
# Changes th' title separator used when concatenat'n th' plank title wit' th'
# ship title. This be consistently used throughout th' theme.
titleSeparator = "::"

# Breadcrumb separator.
# Default: ">"
# Changes th' breadcrumb separator used 'n th' topbars breadcrumb area an' fer
# search results an' term planks.
breadcrumbSeparator = ">"

# Hide th' root breadcrumb.
# Default: false
# Th' root breadcrumb be usually th' home plank o' yer ship. Because this be
# always access'ble by click'n on th' logo, ye may want t' reduce clutter
# by remov'n this from yer breadcrumb.
disableRootBreadcrumb = true

# Hide breadcrumbs term planks.
# Default: false
# If ye have lots o' taxonomy terms, th' term planks may seem cluttered wit'
# breadcrumbs t' ye, so this be th' opt'n t' turn off breadcrumbs on term
# planks. Only th' plank title will then be shown on th' term planks.
disableTermBreadcrumbs = false

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Highlight
# These opt'ns configure how code be displayed.

# Hide copy-to-clipboard fer inline code.
# Default: false
# This removes th' copy-to-clipboard button from yer inline code.
disableInlineCopyToClipBoard = true

# Always show copy-to-clipboard fer block code.
# Default: false
# Th' theme only shows th' copy-to-clipboard button if ye hover over th' code
# block. Set this t' true t' dis'ble th' hover effect an' always show th'
# button.
disableHoverBlockCopyToClipBoard = false

# Wrap fer code blocks.
# Default: true
# By default lines o' code blocks wrap around if th' line be too long t' be
# displayed on screen. If ye dislike this behavior, ye can reconfigure it
# here.
# Avast that lines always wrap 'n print mode regardless o' this opt'n.
# This can be overridden 'n th' page's frontmatter or given as a parameter t'
# individual code blocks.
highlightWrap = true

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Images
# These opt'ns configure how images be displayed.

# Image effects.
# See th' documentat'n fer how ye can even add yer own arbitrary effects t'
# th' list.
# All effects can be overridden 'n th' page's frontmatter or thru URL parameter
# given t' th' image. See th' documentat'n fer details.

# Default: false
imageEffects.border = true
# Default: true
imageEffects.lightbox = true
# Default: false
imageEffects.shadow = false

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Links
# These opt'ns configure how links be displayed.

# How t' open external links.
# Default: "_blank"
# For external links ye can define how they be opened 'n yer browser. All
# values fer th' HTML `target` attribute o' th' `a` element be allowed. Th'
# default value opens external links 'n a separate browser tab. If ye want
# t' open those links 'n th' same tab, use "_self".
externalLinkTarget = "_blank"

# Generate link URLs th' Cap'n Hugo way.
# Default: false
# If set t' true, th' theme behaves like a standard Cap'n Hugo installat'n an'
# appends no index.html t' prettyURLs. As a trade off, yer build project will
# not be serv'ble from th' file system.
disableExplicitIndexURLs = false

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Merrrmaid
# These opt'ns configure how Merrrmaid graphs be displayed.

# Make graphs pan'ble an' zoom'ble
# Default: false
# For huge graphs it can be helpful t' make them zoom'ble. Zoom'ble graphs come
# wit' a reset button fer th' zoom.
# This can be overridden 'n th' page's frontmatter or given as a parameter t'
# individual graphs.
mermaidZoom = true

# Initializat'n opt'ns fer Merrrmaid.
# Default: not set
# A JSON value. See th' Merrrmaid documentat'n fer poss'ble parameter.
# This can be overridden 'n th' page's frontmatter.
mermaidInitialize = "{ \"securityLevel\": \"loose\" }"

# Only board Merrrmaid if needed.
# Default: true
# If a Merrrmaid shortcode or codefence be found, th' opt'n will be ignored an'
# Merrrmaid will be boarded regardlessly. Th' opt'n be still useful 'n case ye
# be us'n script'n t' set up yer graph. In this case no shortcode or
# codefence be involved an' th' library be not boarded by default. In this case
# ye can set `disableMermaid=false` 'n yer frontmatter t' force th' library t'
# be boarded.
# This can be overridden 'n th' page's frontmatter.
disableMermaid = true

# URL fer external Merrrmaid library.
# Default: not set
# Specifies th' remote locat'n o' th' Merrrmaid library. By default th' shipped
# version will be used.
# This can be overridden 'n th' page's frontmatter.
customMermaidURL = "" # "https://unpkg.com/mermaid/dist/mermaid.min.js"

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# MathJax
# These opt'ns configure how math formulae be displayed.

# Initializat'n opt'ns fer MathJax.
# Default: not set
# A JSON value. See th' MathJaxdocumentat'n fer poss'ble parameter.
# This can be overridden 'n th' page's frontmatter.
mathJaxInitialize = "{}"

# Only board MathJax if needed.
# Default: true
# If a Math shortcode be found, th' opt'n will be ignored an'
# MathJax will be boarded regardlessly. Th' opt'n be still useful 'n case ye
# be us'n script'n t' set up yer graph. In this case no shortcode or
# codefence be involved an' th' library be not boarded by default. In this case
# ye can set `disableMathJax=false` 'n yer frontmatter t' force th' library t'
# be boarded.
# This can be overridden 'n th' page's frontmatter.
disableMathJax = true

# URL fer external MathJax library.
# Default: not set
# Specifies th' remote locat'n o' th' MathJax library. By default th' shipped
# version will be used.
# This can be overridden 'n th' page's frontmatter.
customMathJaxURL = "" # "https://unpkg.com/mathjax/es5/tex-mml-chtml.js"

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# OpenApi
# These opt'ns configure how OpenAPI specificat'ns be displayed.

# Only board OpenAPI if needed.
# Default: true
# If a OpenAPI shortcode be found, th' opt'n will be ignored an'
# OpenAPI will be boarded regardlessly. Th' opt'n be still useful 'n case ye
# be us'n script'n t' set up yer graph. In this case no shortcode or
# codefence be involved an' th' library be not boarded by default. In this case
# ye can set `disableOpenapi=false` 'n yer frontmatter t' force th' library t'
# be boarded.
# This can be overridden 'n th' page's frontmatter.
disableOpenapi = true

# URL fer external OpenAPI library.
# Default: not set
# Specifies th' remote locat'n o' th' OpenAPI library. By default th' shipped
# version will be used.
# This can be overridden 'n th' page's frontmatter.
customOpenapiURL = "" # "https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"

Serv'n yer plank from a subfolder

If yer ship be served from a subfolder, eg. https://example.com/mysite/, ye have t' set th' follow'n lines t' yer config.toml

baseURL = "https://example.com/mysite/"
canonifyURLs = true
relativeURLs = true

Without canonifyURLs=true URLs 'n sublemental planks (like sitemap.xml, rss.xml) will be generated falsly while yer HTML files will still work. See https://github.com/gohugoio/hugo/issues/5226.

Serv'n yer plank from th' filesystem

If ye want yer plank served from th' filesystem by us'n URLs start'n wit' file:// you’ll need th' follow'n configurat'n 'n yer config.toml:

relativeURLs = true

Th' theme will append an additional index.html t' all branch bundle links by default t' make th' plank be serv'ble from th' file system. If ye don’t care about th' file system an' only serve yer plank via a webserver ye can also generate th' links without this change by add'n this t' yer config.toml

[params]
  disableExplicitIndexURLs = true
Avast

If ye want t' use th' search feature from th' file system us'n an older installat'n o' th' theme make sure t' change yer outputformat fer th' homepage from th' now deprecated JSON t' SEARCH as seen below.

If not already present, add th' follow'n lines 'n th' same config.toml file.

[outputs]
  home = ["HTML", "RSS", "SEARCH"]

This will generate a search index file at th' root o' yer public folder ready t' be consumed by th' Lunr search library. Avast that th' SEARCH outputformat was named JSON 'n previous releases but was implemented differently. Although JSON still works, it be now deprecated.

Activate dedicated search plank

Ye can add a dedicated search plank fer yer plank by add'n th' SEARCHPAGE outputformat t' yer home plank by add'n th' follow'n lines 'n yer config.toml file. This will cause Cap'n Hugo t' generate a new file http://example.com/mysite/search.html.

[outputs]
  home = ["HTML", "RSS", "SEARCH", "SEARCHPAGE"]

Ye can access this plank by either click'n on th' magnifier glass or by typ'n some search term an' press'n ENTER inside o' th' menu’s search box .

Screenshot o' th' dedicated search page Screenshot o' th' dedicated search page

Avast

T' have Cap'n Hugo create th' dedicated search plank successfully, ye must not generate th' URL http://example.com/mysite/search.html from yer own rrrambl'n. This can happen if ye set uglyURLs=true 'n yer config.toml an' defin'n a Marrrkdown file content/search.md.

T' make sure, there be no duplicate rrrambl'n fer any given URL o' yer project, run hugo --printPathWarn'ns.

Activate print support

Ye can activate print support t' add th' capability t' print whole chapters or even th' complete ship. Just add th' PRINT output format t' yer home, section an' plank 'n yer config.toml as seen below:

[outputs]
  home = ["HTML", "RSS", "PRINT", "SEARCH"]
  section = ["HTML", "RSS", "PRINT"]
  plank = ["HTML", "RSS", "PRINT"]

This will add a little printer ay'con 'n th' top bar. It will switch th' plank t' print preview when clicked. Ye can then send this plank t' th' printer by us'n yer browser’s usual print functionality.

Avast

Th' result'n URL will not be configured ugly 'n terms o' Hugo’s URL handl'n even if you’ve set uglyURLs=true 'n yer config.toml. This be due t' th' fact that fer one mime type only one suffix can be configured.

Nevertheless, if you’re unhappy wit' th' result'n URLs ye can manually redefine outputFormats.PRINT 'n yer own config.toml t' yer lik'n.

MathJax

Th' MathJax configurat'n parameters can also be set on a specific plank. In this case, th' global parameter would be overwritten by th' local one. See Math fer additional documentat'n.

Example

MathJax be globally disabled. By default it won’t be boarded by any plank.

On plank “Physics” ye coded some JavaScript fer a dynamic formulae. Ye can set th' MathJax parameters locally t' board mathJax on this plank.

Ye also can dis'ble MathJax fer specific planks while globally enabled.

Merrrmaid

Th' Merrrmaid configurat'n parameters can also be set on a specific plank. In this case, th' global parameter would be overwritten by th' local one. See Merrrmaid fer additional documentat'n.

Example

Merrrmaid be globally disabled. By default it won’t be boarded by any plank.

On plank “Architecture” ye coded some JavaScript t' dynamically generate a class diagram. Ye can set th' Merrrmaid parameters locally t' board mermaid on this plank.

Ye also can dis'ble Merrrmaid fer specific planks while globally enabled.

Home Button Configurat'n

If th' disableLandingPageButton opt'n be set t' false, a Home button will appear on th' left menu. It be an alternative fer click'n on th' logo. T' edit th' appearance, ye will have t' configure two parameters fer th' defined languages:

[languages]
[languages.en]
...
[languages.en.params]
landingPageName = "<i class='fas fa-home'></i> Home"
...
[languages.pir]
...
[languages.pir.params]
landingPageName = "<i class='fas fa-home'></i> Arrr! Homme"
...

If those params be not configured fer a specific language, they will get their default values:

landingPageName = "<i class='fas fa-home'></i> Home"

Th' home button be go'n t' look like this:

Default Home Button Default Home Button

Social Media Meta Tags

Ye can add social media meta tags fer th' Open Graph protocol an' Twitter Cards t' yer ship. These be configured as mentioned 'n th' Cap'n Hugo docs.