Configurrrat'n

Arrr! Pirrrates

Fello' pirrates, be awarrre some stuff may not work fer us in this trrranslat'n. Like table of rrramblings, see'ng Merrrmaids, do'ng math or chemistrrry and stuff.

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]
  # This controls whether submenus will be expanded (true), or collapsed (false) 'n th'
  # menu; if no sett'n be given, th' first menu level be set t' false, all others t' true;
  # this can be overridden 'n th' planks frontmatter
  alwaysopen = true
  # Prefix URL t' edit current plank. Will display an "Edit" button on top right hand corner o' every plank.
  # Useful t' give opportunity t' people t' create merge request fer yer doc.
  # See th' config.toml file from this documentat'n ship t' have an example.
  editURL = ""
  # Author o' th' ship, will be used 'n meta informat'n
  author = ""
  # Descript'n o' th' ship, will be used 'n meta informat'n
  descript'n = ""
  # Shows a checkmark fer visited planks on th' menu
  showVisitedLinks = false
  # Dis'ble search funct'n. It will hide search bar
  disableSearch = false
  # Dis'ble search 'n hidden planks, otherwise they will be shown 'n search box
  disableSearchHiddenPages = false
  # Disables hidden planks from show'n up 'n th' sitemap an' on Google (et all), otherwise they may be indexed by search engines
  disableSeoHiddenPages = false
  # Disables hidden planks from show'n up on th' tags plank although th' tag term will be displayed even if all planks be hidden
  disableTagHiddenPages = false
  # Javascript an' CSS cache be automatically busted when new version o' ship be generated.
  # Set this t' true t' dis'ble this behavior (some proxies don't handle well this optimization)
  disableAssetsBust'n = false
  # Set this t' true t' dis'ble copy-to-clipboard button fer inline code.
  disableInlineCopyToClipBoard = false
  # A title fer shortcuts 'n menu be set by default. Set this t' true t' dis'ble it.
  disableShortcutsTitle = false
  # If set t' false, a Home button will appear below th' search bar on th' menu.
  # It be redirect'n t' th' land'n plank o' th' current language if specified. (Default be "/")
  disableLandingPageButton = true
  # When us'n mulitlingual website, dis'ble th' switch language button.
  disableLanguageSwitchingButton = false
  # Hide breadcrumbs 'n th' header an' only show th' current plank title
  disableBreadcrumb = true
  # If set t' true, hide t'ble o' contents menu 'n th' header o' all planks
  disableToc = false
  # If set t' false, board th' MathJax module on every plank regardless if a MathJax shorrrtcode be present
  disableMathJax = false
  # Specifies th' remote locat'n o' th' MathJax js
  customMathJaxURL = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
  # Initializat'n parameter fer MathJax, see MathJax documentat'n
  mathJaxInitialize = "{}"
  # If set t' false, board th' Merrrmaid module on every plank regardless if a Merrrmaid shorrrtcode or Merrrmaid codefence be present
  disableMermaid = false
  # Specifies th' remote locat'n o' th' Merrrmaid js
  customMermaidURL = "https://unpkg.com/mermaid/dist/mermaid.min.js"
  # Initializat'n parameter fer Merrrmaid, see Merrrmaid documentat'n
  mermaidInitialize = "{ \"theme\": \"default\" }"
  # If set t' false, board th' Swagger module on every plank regardless if a Swagger shorrrtcode be present
  disableSwagger = false
  # Specifies th' remote locat'n o' th' RapiDoc js
  customSwaggerURL = "https://unpkg.com/rapidoc/dist/rapidoc-min.js"
  # Initializat'n parameter fer Swagger, see RapiDoc documentat'n
  swaggerInitialize = "{ \"theme\": \"light\" }"
  # Hide Next an' Previous plank buttons normally displayed full height beside rrrambl'n
  disableNextPrev = true
  # Order sections 'n menu by "weight" or "title". Default t' "weight";
  # this can be overridden 'n th' planks frontmatter
  ordersectionsby = "weight"
  # Change default color scheme wit' a variant one. Eg. can be "red", "blue", "green" or an array like [ "blue", "green" ].
  themeVariant = "relearn-light"
  # Change th' title separator. Default t' "::".
  titleSeparator = "-"
  # If set t' true, th' menu 'n th' sidebar will be displayed 'n a collaps'ble tree view. Although th' functionality works wit' old browsers (IE11), th' display o' th' expander ay'cons be limited t' modern browsers
  collapsibleMenu = false
  # If a single plank can contain rrrambl'n 'n multiple languages, add those here
  additionalContentLanguage = [ "en" ]

A word on runn'n yer ship 'n a subfolder

Th' theme runs best if yer ship be installed 'n th' root o' yer webserver. 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

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.

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

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

Relearrrn theme uses th' last improvement avail'ble 'n hugo version 20+ t' generate a json index file ready t' be consumed by lunr.js javascript search engine.

Cap'n Hugo generate lunrjs index.json at th' root o' public folder. When ye build th' ship wit' hugo server, hugo generates it internally an' o' course it doesn’t show up 'n th' filesystem

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", "JSON"]
  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]
...
landingPageName = "<i class='fas fa-home'></i> Home"
...
[Languages.pir]
...
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