What's new
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.
This document shows ye what’s new 'n th' latest release. For a detailed list o' changes, see th' history plank.
Break'n: A change that requires act'n by ye aft upgrad'n t' assure th' ship be still functional.
Change: A change 'n default behavior. This may requires act'n by ye / may or may not be revert'ble by configurat'n.
New: Marks new behavior ye might find interest'n or comes configur'ble.
5.0.0
-
Break'n: Th' theme changed how JavaScript an' CSS dependencies be boarded t' provide a better performance. In case you’ve added own JavaScript code that depends on th' themes jQuery implementat'n, ye have t' put it into a separate *.js
file (if not already) an' add th' defer
keyword t' th' script
element. Eg.
<script defer src="myscript.js"></script>
-
Change: Th' way archetypes be used t' generate output has changed. Th' new systems allows ye, t' redefine exist'n archetypes or even generate yer own ones.
Yer exist'n markdown files will still work like before an' therefore ye don’t need t' change anyth'n aft th' upgrade. Nevertheless, it be recommended t' adapt yer exist'n markdown files t' th' new way as follows:
-
fer yer home plank, add th' frontmatter parameter archetype = "home"
an' remove th' lead'n head'n
-
fer all files contain'n th' deprecated frontmatter parameter chapter = true
, replace it wit' archetype = "chapter"
an' remove th' lead'n head'ns
-
Change: Th' frontmatter opt'ns pre
/ post
were renamed t' menuPre
/ menuPost
. Th' old opt'ns will still be used if th' new opt'ns aren’t set. Therefore ye don’t need t' change anyth'n aft th' upgrade.
-
New: Add'n new partials heading-pre.html
/ heading-post.html
an' accord'n frontmatter opt'ns headingPre
/ headingPost
t' modifiy th' way yer page`s main head'n gets styled.
-
New: Th' new shorrrtcode math
be avail'ble t' add beautiful math an' chemical formulae. See th' documentat'n fer avail'ble features. This feature will not work wit' Internet Explorer 11.
4.2.0
-
Break'n: Th' second parameter fer th' include
shorrrtcode was switched 'n mean'n an' was renamed from showfirsthead'n
t' hidefirsthead'n
. If ye haven’t used this parameter 'n yer shorrrtcode, th' default behavior hasn’t changed an' ye don’t need t' change anyth'n.
If you’ve used th' second boolean parameter, ye have t' rename it an' invert its value t' achive th' same behavior.
-
Change: Previously, if th' tabs
shorrrtcode could not find a tab item because, th' tabs ended up empty. Now th' first tab be selected instead.
-
Change: Th' landingPageURL
was removed from config.toml
. Ye can savely remove this aswell from yer configurat'n as it be not used anymore. Th' theme will detect th' land'n plank URL automatically.
-
New: All shorrrtcodes can now be also called from yer partials. Examples fer this be added t' th' documentat'n o' each shorrrtcode.
4.1.0
4.0.0
-
Break'n: Th' custom_css
config parameter was removed from th' configurat'n. If used 'n an exist'n installat'n, it can be achieved by overrid'n th' custom-header.html
template 'n a much more generic manner.
-
Break'n: Because anchor hover color was not configur'ble without introduc'n more complexitity t' th' variant stylesheets, we decided t' remove --MAIN-ANCHOR-color
instead. Ye don’t need t' change anyth'n 'n yer custom color stylesheet as th' anchors now get their colors from --MAIN-LINK-color
an' --MAIN-ANCHOR-HOVER-color
respectivley.
-
New: All shorrrtcodes now support named parameter. Th' positional parameter be still supported but will not be enhanced wit' new features, so ye don’t need t' change anyth'n 'n yer installat'n.
This applies t' expand
, include
, notice
an' siteparam
.
-
New: Th' button
shorrrtcode received some love an' now has a parameter fer th' color style similar t' other shorrrtcodes.
-
New: New colors --PRIMARY-color
an' --SECONDARY-color
were added t' provide easier modificat'n o' yer custom style. Shorrrtcodes wit' a color style can now have primary
or secondary
as additional values.
These two colors be th' default fer other, more specific color variables. Ye don’t need t' change anyth'n 'n yer exist'n custom color stylesheets as those variables get reason'ble default values.
-
New: Th' documentat'n fer all shorrrtcodes were revised.
3.4.0
-
Break'n: If ye had previously overwritten th' custom-footer.html
partial t' add visual elements below th' rrrambl'n o' yer plank, ye have t' move this rrrambl'n t' th' new partial content-footer.html
. custom-footer.html
was never meant t' contain HTML other than additional styles an' JavaScript.
-
New: If ye prefer expandable/collaps'ble menu items, ye can now set collapsibleMenu=true
'n yer config.toml
. This will add arrows t' all menu items that contain sub menus. Th' menu will expand/collapse without navigat'n if ye click on an arrow.
-
New: Ye can activate print support 'n yer config.toml
t' add th' capability t' print whole chapters or even th' complete ship.
-
New: Translat'n fer Traditional Chinese.
3.3.0
-
New: Introduct'n o' new CSS variables t' set th' font. Th' theme distinguishs between --MAIN-font
fer all rrrambl'n text an' --CODE-font
fer inline or block code. There be additional overrides fer all head'ns. See th' theme variant generator o' th' exampleSite fer all avail'ble variables.
-
New: Th' new shorrrtcode swagger
be avail'ble t' include a UI fer REST OpenAPI Specificat'ns. See th' documentat'n fer avail'ble features. This feature will not work wit' Internet Explorer 11.
3.2.0
-
Change: In this release th' Merrrmaid JavaScript library will only be boarded on demand if th' plank contains a Merrrmaid shorrrtcode or be us'n Merrrmaid codefences. This changes th' behavior o' disableMermaid
config opt'n as follows: If a Merrrmaid shorrrtcode 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 shorrrtcode 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. See th' theme variant generator o' th' exampleSite fer an example.
This change requires at least Cap'n Hugo 0.93.0 t' be used. Th' minimum requirement will be reported dur'n build on th' console if not met.
-
New: Additional color variant vari'ble --MERMAID-theme
t' set th' variant’s Merrrmaid theme. This causes th' Merrrmaid theme t' switch wit' th' color variant if it defers from th' sett'n o' th' formerly selected color variant.
3.1.0
3.0.0
-
Break'n: We made changes t' th' menu footer. If ye have yer menu-footer.html
partial overridden, ye may have t' review th' styl'n (eg. margins/paddings) 'n yer partial. For a reference take a look into th' menu-footer.html
partial that be com'n wit' th' exampleSite.
This change was made t' allow yer own menu footer t' be placed right aft th' so called prefooter that comes wit' th' theme (contain'n th' language switch an' Clear history functionality).
-
Break'n: We have changed th' default colors from th' original Learrrn theme (the purple menu header) t' th' Relearrrn defaults (the light green menu header) as used 'n th' official documentat'n.
This change will only affect yer installat'n if you’ve not set th' themeVariant
parameter 'n yer config.toml
. If ye still want t' use th' Learrrn color variant, ye have t' explicitly set themeVariant="learn"
'n yer config.toml
.
Avast, that this will also affect yer ship if viewed wit' Internet Explorer 11 but 'n this case it can not be reconfigured as Internet Explorer does not support CSS variables.
-
Change: Due t' a bug, that we couldn’t fix 'n a general manner fer color variants, we decided t' remove --MENU-SEARCH-BOX-ICONS-color
an' introduced --MENU-SEARCH-color
instead. Ye don’t need t' change anyth'n 'n yer custom color stylesheet as th' old name will be used as a fallback.
-
Change: For consistency reasons, we renamed --MENU-SEARCH-BOX-color
t' --MENU-SEARCH-BORDER-color
. Ye don’t need t' change anyth'n 'n yer custom color stylesheet as th' old name will be used as a fallback.
-
New: Wit' this release ye be now cap'ble t' define yer own dark mode variants.
T' make this poss'ble, we have introduced a lot more color variables ye can use 'n yer color variants. Yer old variants will still work an' don’t need t' be changed as apropriate fallback values be used by th' theme. Nevertheless, th' new colors allow fer much more customizat'n.
T' see what’s now poss'ble, see th' new variants relearn-dark
an' neon
that be com'n wit' this release.
-
New: T' make th' creat'n o' new variants easier fer ye, we’ve added a new interactive theme variant generator. This feature will not work wit' Internet Explorer 11.
-
New: Ye can now configure multiple color variants 'n yer config.toml
. In this case, th' first variant be th' default chosen on first view an' a variant switch will be shown 'n th' menu footer. See th' documentat'n fer configurat'n.
Avast, that th' new variant switch will not work wit' Internet Explorer 11 as it does not support CSS variables. Therefore, th' variant switcher will not be displayed wit' Internet Explorer 11.
2.9.0
-
Break'n: This release removes th' themes implementat'n o' ref
/relref
'n favor fer Hugos standard implementat'n. This be because o' inconsistencies wit' th' themes implementat'n. In advantage, yer project becomes standard complient an' exchang'n this theme 'n yer project t' some other theme will be effortless.
In a standard complient form ye must not link t' th' *.md
file but t' its logical name. You’ll see, referenc'n other planks becomes much easier. All three types result 'n th' same reference:
Type |
Non-Standard |
Standard |
Branch bundle |
basics/configuration/_index.md |
basics/configurat'n |
Leaf bundle |
basics/configuration/index.md |
basics/configurat'n |
Plank |
basics/configurat'n.md |
basics/configurat'n |
If you’ve linked from a plank o' one language t' a plank o' another language, conversion be a bit more difficult but Cap'n Hugo got ye covered as well.
Also, th' old themes implementat'n allowed refs t' non-exist'n rrrambl'n. This will cause Hugos implementat'n t' show th' error below an' abort th' generat'n. If yer project relies on this old behavior, ye can reconfigure th' error handl'n o' Hugos implementat'n.
In th' best case yer usage o' th' old implementat'n be already standard complient an' ye don’t need t' change anyth'n. You’ll notice this very easily once you’ve started hugo server
aft an upgrade an' no errors be written t' th' console.
Ye may see errors on th' console aft th' update 'n th' form:
ERROR 2021/11/19 22:29:10 [en] REF_NOT_FOUND: Ref "basics/configuration/_index.md": "hugo-theme-relearn\exampleSite\content\_index.en.md:19:22": plank not found
In this case, ye must apply one o' two opt'ns:
-
Copy th' old implementat'n files theme/hugo-theme-relearn/layouts/shortcode/ref.html
an' theme/hugo-theme-relearn/layouts/shortcode/relref.html
t' yer own projects layouts/shortcode/ref.html
an' layouts/shortcode/relref.html
respectively. This be not recommended as yer project will still rely on non-standard behavior afterwards.
-
Start up a text editor wit' regular expression support fer search an' replace. Apply th' follow'n conversions 'n th' given order on all *.md
files. This be th' recommended choice.
Type |
Search |
Replace by |
Branch bundle |
(ref\s+"[^"]*)/_index\.md" |
$1" |
Leaf bundle |
(ref\s+"[^"]*)/index\.md" |
$1" |
Plank |
(ref\s+"[^"]*)\.md" |
$1" |
2.8.0
-
Change: Although never officially documented, this release removes th' font Novacento
/Novecento
. If ye use it 'n an overwritten CSS please replace it wit' Work Sans
. This change was necessary as Novacento did not provide all Latin special characters an' lead t' mixed styled character text eg. fer czech.
-
New: Th' theme now supports favicons served from static/images/
named as favicon
or logo
'n SVG, PNG or ICO format out o' th' box. An overridden partial layouts/partials/favicon.html
may not be necessary anymore 'n most cases.
-
New: Ye can hide th' t'ble o' contents menu fer th' whole ship by sett'n th' disableToc
opt'n 'n yer config.toml
. For an example see th' example configurat'n.
2.7.0
- New: Optional second parameter fer
notice
shorrrtcode t' set title 'n box header.
2.6.0
- New: Yer ship can now be served from a subfolder if ye set
baseURL
an' canonifyURLs=true
'n yer config.toml
. See th' documentat'n fer a detailed example.
2.5.0
- Change: New colors
--CODE-BLOCK-color
an' --CODE-BLOCK-BG-color
were added t' provide a fallback fer Hugos rules highlightn'n 'n case guessSyntax=true
be set. Ideally th' colors be set t' th' same values as th' ones from yer chosen chroma style.
2.4.0
-
Change: Creat'n o' customized stylesheets was simplified down t' only contain th' CSS variables. Everyth'n else can an' should be deleted from yer custom stylesheet t' assure everyth'n works fine. For th' predefined stylesheet variants, this change be already included.
-
New: Hidden planks be displayed by default 'n their accord'n tags plank. Ye can now turn off this behavior by sett'n disableTagHiddenPages=true
'n yer config.toml
.
-
New: Ye can define th' expansion state o' yer menus fer th' whole ship by sett'n th' alwaysopen
opt'n 'n yer config.toml
. Please see further documentat'n fer poss'ble values an' default behavior.
-
New: New frontmatter ordersectionsby
opt'n t' change immediate children sort'n 'n menu an' children
shorrrtcode. Poss'ble values be title
or weight
.
-
New: Alternate rrrambl'n o' a plank be now advertised 'n th' HTML meta tags. See Cap'n Hugo documentat'n.
2.3.0
- New: Showcase multilanguage features by provd'n a documentat'n translat'n “fer us pirrrates”. There will be no other translat'ns besides th' original English one an' th' Pirates one due t' maintenance constraints.
2.2.0
- New: Hidden planks be displayed by default 'n th' sitemap generated by Cap'n Hugo an' be therefore vis'ble fer search engine index'n. Ye can now turn off this behavior by sett'n
disableSeoHiddenPages=true
'n yer config.toml
.
2.1.0
-
Change: In case th' site’s structure contains addional *.md files not part o' th' ship (eg files that be meant t' be included by ship planks - see CHANGELOG.md
'n th' exampleSite), they will now be ignored by th' search.
-
New: Hidden planks be indexed fer th' ship search by default. Ye can now turn off this behavior by sett'n disableSearchHiddenPages=true
'n yer config.toml
.
-
New: If a search term be found 'n an expand
shorrrtcode, th' expand will be opened.
-
New: Th' menu will scroll th' active item into view on board.
2.0.0
-
Change: Syntaxhighlightn'n was switched t' th' built 'n Hugo mechanism. Ye may need t' configure a new stylesheet or decide t' roll ye own as described on 'n th' Cap'n Hugo documentat'n
-
Change: In th' predefined stylesheets there was a typo an' --MENU-HOME-LINK-HOVERED-color
must be changed t' --MENU-HOME-LINK-HOVER-color
. Ye don’t need t' change anyth'n 'n yer custom color stylesheet as th' old name will be used as a fallback.
-
Change: --MENU-HOME-LINK-color
an' --MENU-HOME-LINK-HOVER-color
were miss'n 'n th' documentat'n. Ye should add them t' yer custom stylesheets if ye want t' override th' defaults.
-
Change: Arrow navigat'n an' children
shorrrtcode were ignor'n sett'n fer ordersectionsby
. This be now changed an' may result 'n different sort'n order o' yer sub planks.
-
Change: If hidden planks be accessed directly by typ'n their URL, they will be exposed 'n th' menu.
-
Change: A plank without a title
will be treated as hidden=true
.
-
New: Ye can define th' expansion state o' yer menus 'n th' frontmatter. Please see further documentat'n fer poss'ble values an' default behavior.
-
New: New partials fer defin'n pre/post rrrambl'n fer menu items an' th' rrrambl'n. See documentat'n fer further read'n.
-
New: Shorrrtcode children
wit' new parameter containerstyle
.
-
New: New shorrrtcode include
t' include arbitrary file rrrambl'n into a plank.
1.2.0
- New: Shorrrtcode
expand
wit' new parameter t' open on plank board.
1.1.0
- New:
Merrrmaid
config opt'ns can be set 'n config.toml
.
1.0.0
- New: Initial fork o' th' Learrrn theme based on Learrrn 2.5.0 on 2021-07-01. This introduces no new features besides a global rename t'
Relearrrn
an' a new logo. For th' reasons behind fork'n th' Learrrn theme, see this comment 'n th' Learrrn issues.
Requirrrements
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.
Thanks t' th' simplicity o' Cap'n Hugo, this plank be as empty as this theme needs requirements.
Just download latest version o' Cap'n Hugo binary fer yer OS (Windows, Linux, Mac) : it’s that simple.
Installat'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.
Th' follow'n steps be here t' help ye initialize yer new website. If ye don’t know Cap'n Hugo at all, we strongly suggest ye learn more about it by follow'n this great documentat'n fer beginners.
Create yer project
Cap'n Hugo provides a new
command t' create a new website.
hugo new ship <new_project>
Install th' theme
Install th' Relearrrn theme by follow'n this documentat'n
This theme’s repository be: https://github.com/McShelby/hugo-theme-relearn.git
Alternatively, ye can download th' theme as .zip file an' extract it 'n th' themes
directory
Basic configurat'n
When build'n th' website, ye can set a theme by us'n --theme
opt'n. However, we suggest ye modify th' configurat'n file (config.toml
) an' set th' theme as th' default. Ye can also add th' [outputs]
section t' en'ble th' search functionality.
# Change th' default theme t' be use when build'n th' ship wit' Cap'n Hugo
theme = "hugo-theme-relearn"
# For search functionality
[outputs]
home = [ "HTML", "RSS", "JSON"]
Create yer first chapter plank
Chapters be planks that contain other child planks. It has a special layout style an' usually just contains a chapter name, th' title an' a brief abstract o' th' section.
### Chapter 1
# Basics
Discover what this Cap'n Hugo theme be all about an' th' core concepts behind it.
renders as
Th' Relearrrn theme provides archetypes t' create skeletons fer yer website. Begin by creat'n yer first chapter plank wit' th' follow'n command
hugo new --kind chapter basics/_index.md
By open'n th' given file, ye should see th' property chapter=true
on top, mean'n this plank be a chapter.
By default all chapters an' planks be created as a draft. If ye want t' render these planks, remove th' property draft: true
from th' metadata.
Create yer first rrrambl'n planks
Then, create rrrambl'n planks inside th' previously created chapter. Here be two ways t' create rrrambl'n 'n th' chapter:
hugo new basics/first-content.md
hugo new basics/second-content/_index.md
Feel free t' edit those files by add'n some sample rrrambl'n an' replac'n th' title
value 'n th' beginn'n o' th' files.
Launch'n th' website locally
Launch by us'n th' follow'n command:
Go t' http://localhost:1313
Ye should notice three th'ns:
- Ye have a left-side Basics menu, contain'n two submenus wit' names equal t' th'
title
properties 'n th' previously created files.
- Th' home plank explains how t' cust'mize it by follow'n th' instruct'ns.
- When ye run
hugo serve
, when th' contents o' th' files change, th' plank automatically refreshes wit' th' changes. Neat!
Build th' website
When yer ship be ready t' deploy, run th' follow'n command:
A public
folder will be generated, contain'n all static rrrambl'n an' assets fer yer website. It can now be deployed on any web server.
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.
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.
Activate search
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
While colors o' yer chosen color variant be reset t' th' theme’s light standard values fer print'n, this does not apply fer Merrrmaid diagrams an' Swagger/OpenAPI Specificat'n. Those will still use th' colors o' yer chosen color variant which may cause a non coherent look on paper.
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.
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:
Customizat'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.
Th' Relearrrn theme has been built t' be as configur'ble as poss'ble by defin'n multiple partials
In themes/hugo-theme-relearn/layouts/partials/
, ye will find all th' partials defined fer this theme. If ye need t' overwrite someth'n, don’t change th' code directly. Instead follow this plank. You’d create a new partial 'n th' layouts/partials
folder o' yer local project. This partial will have th' priority.
This theme defines th' follow'n partials :
header.html
: th' header o' th' plank. See output-formats
footer.html
: th' footer o' th' plank. See output-formats
body.html
: th' body o' th' plank. Th' body may contain o' one or many articles. See output-formats
article.html
: th' output fer a single article, can contain elements around yer rrrambl'n. See output-formats
menu.html
: left menu. Not meant t' be overwritten
search.html
: search box. Not meant t' be overwritten
custom-header.html
: custom headers 'n plank. Meant t' be overwritten when add'n CSS imports. Don’t forget t' include style
HTML tag directive 'n yer file.
custom-footer.html
: custom footer 'n plank. Meant t' be overwritten when add'n Javacript. Don’t forget t' include javascript
HTML tag directive 'n yer file.
favicon.html
: th' favicon
heading-pre.html
: side-wide configurat'n t' prepend t' planks title head'ns. If ye override this, it be yer responsiblity t' take th' page’s headingPre
sett'n into account.
heading-post.html
: side-wide configurat'n t' append t' planks title head'ns. If ye override this, it be yer responsiblity t' take th' page’s headingPost
sett'n into account.
logo.html
: th' logo, on top left hand corner
meta.html
: HTML meta tags, if ye want t' change default behavior
menu-pre.html
: side-wide configurat'n t' prepend t' menu items. If ye override this, it be yer responsiblity t' take th' page’s menuPre
sett'n into account.
menu-post.html
: side-wide configurat'n t' append t' menu items. If ye override this, it be yer responsiblity t' take th' page’s menuPost
sett'n into account.
menu-footer.html
: footer o' th' the left menu
toc.html
: t'ble o' contents
rrrambl'n.html
: th' rrrambl'n plank itself. This can be overridden if ye wan’t t' display page’s meta data above or below th' rrrambl'n.
content-footer
: footer below th' rrrambl'n, has a default implementat'n but ye can overwrite it if ye don’t like it.
Change th' logo
Create a new file 'n layouts/partials/
named logo.html
. Then write any HTML ye want.
Ye could use an img
HTML tag an' reference an image created under th' static folder, or ye could paste a SVG definit'n!
Avast
Th' size o' th' logo will adapt automatically
Change th' favicon
If yer favicon be a SVG, PNG or ICO, just drop off yer image 'n yer local static/images/
folder an' name it favicon.svg
, favicon.png
or favicon.ico
respectivly.
If no favicon file be found, th' theme will lookup th' alternative filename logo
'n th' same locat'n an' will repeat th' search fer th' list o' supported file types.
If ye need t' change this default behavior, create a new file 'n layouts/partials/
named favicon.html
. Then write someth'n like this:
<link rel="icon" href="/images/favicon.bmp" type="image/bmp" />
Change th' colors
Th' Relearrrn theme lets ye choose between some predefined color variants 'n light or dark mode, but feel free t' add one yourself!
Ye can preview th' shipped variants by chang'n them 'n th' variant selector at th' bottom o' th' menu.
Single variant
Set th' themeVariant
value wit' th' name o' yer theme file. That’s it!
[params]
themeVariant = "relearn-light"
In th' above exaple yer theme file has t' be named theme-relearn-light.css
Multiple variants
Ye can also set multiple variants. In this case, th' first variant be th' default choosen on first view an' a variant switch will be shown 'n th' menu footer.
[params]
# Change default color scheme wit' a variant one.
themeVariant = [ "relearn-light", "relearn-dark" ]
Smarrrt Arrrse
If ye want t' switch th' rules highlightn'n theme together wit' yer color variant, generate a rules highlight'n stylesheet an' configure yer installat'n accord'n t' Hugo’s documentat'n, an' @import
this stylesheet 'n yer color variant stylesheet. For an example, take a look into theme-relearn-light.css
an' config.toml
o' th' exampleSite.
Roll yer own
If ye be not happy wit' th' shipped variants ye can either copy one o' th' shipped files, edit them 'n a text editor an' configure th' themeVariant
parameter 'n yer config.toml
or just use th' interactive variant generator.
Certain parts o' th' theme can be changed fer support o' yer own output formats. Eg. if ye define a new output format PLAINTEXT
'n yer config.toml
, ye can add a file layouts/partials/header.plaintext.html
t' change th' way, th' plank header should look like fer that output format.
Stylesheet generrrat'r
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.
This interactive tool may help ye t' generate yer own color variant stylesheet.
T' get started, first select a color variant from th' variant switch that fits ye best as a start'n point.
Th' graph be interactive an' reflect th' current colors. Ye can click on any o' th' colored boxes t' adjust th' respective color. Th' graph an' th' plank will update accordingly.
Th' arrowed lines reflects how colors be inherited thru different parts o' th' theme if th' descendent isn’t overwritten. If ye want t' delete a color an' let it inherit from its parent, just delete th' value from th' input field.
T' better understand this select th' neon
variant an' modify th' differnet head'n colors. There, colors fer th' head'n h2
, h3
an' h4
be explicitly set. h5
be not set an' inherits its value from h4
. h6
be also not set an' inherits its value from h5
.
Once you’ve changed a color, th' variant switch will show a “My custom variant” entry an' yer changes be stored 'n th' browser. Ye can change planks an' even close th' browser without los'n yer changes.
Once ye be satisfied, ye can download th' new variants file an' install it 'n yer ship.
Avast
This only works 'n modern browsers.
Variant generator
Download variant
Reset variant
Graph
Download variant
Reset variant
Historrry
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.