Showcase
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Discover what this Cap'n Hugo theme be all about an' th' core-concepts behind it.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids 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.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids 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.
Cap'n Hugo provides a new
command t' create a new website.
hugo new ship <new_project>
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
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"]
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.
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 by us'n th' follow'n command:
hugo serve
Go t' http://localhost:1313
Ye should notice three th'ns:
title
properties 'n th' previously created files.hugo serve
, when th' contents o' th' files change, th' plank automatically refreshes wit' th' changes. Neat!When yer ship be ready t' deploy, run th' follow'n command:
hugo
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.
This website can be automatically published an' hosted wit' Netlify (Read more about Automated HUGO deployments wit' Netlify). Alternatively, ye can use GitHub planks
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids 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.
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.
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.
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.
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.
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.
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.
attachment
an' notice
shorrrtcodes have a new parameter t' override th' default ay'con. Allowed values be all Font Awesome 5 Free ay'cons.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.
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" |
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.
notice
shorrrtcode t' set title 'n box header.baseURL
an' canonifyURLs=true
'n yer config.toml
. See th' documentat'n fer a detailed example.--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.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.
disableSeoHiddenPages=true
'n yer config.toml
.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.
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.
expand
wit' new parameter t' open on plank board.Merrrmaid
config opt'ns can be set 'n config.toml
.Relearrrn
an' a new logo. For th' reasons behind fork'n th' Learrrn theme, see this comment 'n th' Learrrn issues.Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
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' 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" ]
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
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.
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.
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 need a class diagram. Ye can set th' Merrrmaid parameters locally t' only board mermaid on this plank (not on th' others).
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:
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids 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. Not meant t' be overwrittenfooter.html
: th' footer o' th' plank.Not meant t' be overwrittenmenu.html
: left menu. Not meant t' be overwrittensearch.html
: search box. Not meant t' be overwrittencustom-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' faviconlogo.html
: th' logo, on top left hand cornermeta.html
: HTML meta tags, if ye want t' change default behaviormenu-pre.html
: side-wide configurat'n t' prepend t' menu items. If ye override this, it be yer responsiblity t' take th' page’s pre
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 post
sett'n into account.menu-footer.html
: footer o' th' the left menutoc.html
: t'ble o' contentsrrrambl'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.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!
Th' size o' th' logo will adapt automatically
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" />
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.
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
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" ]
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.
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.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids 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.
This only works 'n modern browsers.
Download variant Reset variant
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Find out how t' create an' org'nize yer rrrambl'n quickly an' intuitively.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
In Cap'n Hugo, planks be th' core o' yer ship. Once it be configured, planks be definitely th' added value t' yer documentat'n ship.
Org'nize yer ship like any other Cap'n Hugo project. Typically, ye will have a rrrambl'n folder wit' all yer planks.
rrrambl'n
├── level-one
│ ├── level-two
│ │ ├── level-three
│ │ │ ├── level-four
│ │ │ │ ├── _index.md <-- /level-one/level-two/level-three/level-four
│ │ │ │ ├── page-4-a.md <-- /level-one/level-two/level-three/level-four/page-4-a
│ │ │ │ ├── page-4-b.md <-- /level-one/level-two/level-three/level-four/page-4-b
│ │ │ │ └── page-4-c.md <-- /level-one/level-two/level-three/level-four/page-4-c
│ │ │ ├── _index.md <-- /level-one/level-two/level-three
│ │ │ ├── page-3-a.md <-- /level-one/level-two/level-three/page-3-a
│ │ │ ├── page-3-b.md <-- /level-one/level-two/level-three/page-3-b
│ │ │ └── page-3-c.md <-- /level-one/level-two/level-three/page-3-c
│ │ ├── _index.md <-- /level-one/level-two
│ │ ├── page-2-a.md <-- /level-one/level-two/page-2-a
│ │ ├── page-2-b.md <-- /level-one/level-two/page-2-b
│ │ └── page-2-c.md <-- /level-one/level-two/page-2-c
│ ├── _index.md <-- /level-one
│ ├── page-1-a.md <-- /level-one/page-1-a
│ ├── page-1-b.md <-- /level-one/page-1-b
│ └── page-1-c.md <-- /level-one/page-1-c
├── _index.md <-- /
└── page-top.md <-- /page-top
_index.md
be required 'n each folder, it’s yer “folder home page”
Th' Relearrrn theme defines two types o' planks. Default an' Chapter. Both can be used at any level o' th' documentat'n, th' only difference be'n layout display.
A Chapter displays a plank meant t' be used as introduct'n fer a set o' child planks. Commonly, it contains a simple title an' a catch line t' define rrrambl'n that can be found under it.
Ye can define any HTML as prefix fer th' menu. In th' example below, it’s just a number but that could be an ay'con.
+++
chapter = true
pre = "<b>1. </b>"
title = "Basics"
weight = 5
+++
### Chapter 1
# Basics
Discover what this Cap'n Hugo theme be all about an' th' core-concepts behind it.
T' tell th' Relearrrn theme t' consider a plank as a chapter, set chapter=true
'n th' Front Matter o' th' plank.
A Default plank be any other rrrambl'n plank.
+++
title = "Installation"
weight = 15
+++
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 t' train by follow'n this great documentat'n fer beginners.
Cap'n Hugo provides a new
command t' create a new website.
hugo new ship <new_project>
Th' Relearrrn theme provides archetypes t' help ye create this kind o' planks.
Each Cap'n Hugo plank has t' define a Front Matter 'n toml, yaml or json. This ship will use toml 'n all cases.
Th' Relearrrn theme uses th' follow'n parameters on top o' Cap'n Hugo ones :
+++
# T'ble o' contents (toc) be enabled by default. Set this parameter t' true t' dis'ble it.
# Avast: Toc be always disabled fer chapter planks
disableToc = false
# If set, this will be used fer th' page's menu entry (instead o' th' `title` attribute)
menuTitle = ""
# If set, this will explicitly override common rules fer th' expand state o' a page's menu entry
alwaysopen = true
# If set, this will explicitly override common rules fer th' sort'n order o' a page's submenu entries
ordersectionsby = "title"
# Th' title o' th' plank 'n menu will be prefixed by this HTML rrrambl'n
pre = ""
# Th' title o' th' plank 'n menu will be postfixed by this HTML rrrambl'n
post = ""
# Set th' plank as a chapter, chang'n th' way it's displayed
chapter = false
# Hide a menu entry by sett'n this t' true
hidden = false
# Display name o' this plank modifier. If set, it will be displayed 'n th' footer.
LastModifierDisplayName = ""
# Email o' this plank modifier. If set wit' LastModifierDisplayName, it will be displayed 'n th' footer
LastModifierEmail = ""
+++
In th' plank frontmatter, add a pre
param t' insert any HTML code before th' menu label. Th' example below uses th' GitHub ay'con.
+++
title = "GitHub repo"
pre = "<i class='fab fa-github'></i> "
+++
Cap'n Hugo provides a flex'ble way t' handle order fer yer planks.
Th' simplest way be t' set weight
parameter t' a number.
+++
title = "My page"
weight = 5
+++
By default, th' Relearrrn theme will use a page’s title
attribute fer th' menu item (or linkTitle
if defined).
But a page’s title has t' be descriptive on its own while th' menu be a hierarchy.
We’ve added th' menuTitle
parameter fer that purpose:
For example (for a plank named content/install/linux.md
):
+++
title = "Install on Linux"
menuTitle = "Linux"
+++
Ye can change how th' theme expands menu entries on th' side o' th' rrrambl'n wit' th' alwaysopen
sett'n on a per plank basis. 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' menu based on th' follow'n rules:
alwaysopen=false
alwaysopen=true
alwaysopen=true
; this proceeds recursivleyYe can see this feature 'n act'n on th' example plank fer children shorrrtcode an' its children planks.
T' configure yer plank, ye basically have three choices:
_index.md
document 'n rrrambl'n
folder an' fill th' file wit' Marrrkdown rrrambl'nindex.html
file 'n th' static
folder an' fill th' file wit' HTML rrrambl'nFello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Us'n th' command: hugo new [relative new rrrambl'n path]
, ye can start a rrrambl'n file wit' th' date an' title automatically set. While this be a welcome feature, active writers need more: archetypes.
It be pre-configured skeleton planks wit' default front matter. Please refer t' th' documentat'n fer types o' plank t' understand th' differences.
T' create a Chapter plank, run th' follow'n commands
hugo new --kind chapter <name>/_index.md
It will create a plank wit' predefined Front-Matter:
+++
chapter = true
pre = "<b>X. </b>"
title = "{{ replace .Name "-" " " | title }}"
weight = 5
+++
### Chapter X
# Some Chapter title
Lorem Ipsum.
T' create a default plank, run either one o' th' follow'n commands either
hugo new <chapter>/<name>/_index.md
or
hugo new <chapter>/<name>.md
It will create a plank wit' predefined Front-Matter:
+++
title = "{{ replace .Name "-" " " | title }}"
weight = 5
+++
Lorem Ipsum.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Let’s face it: Writ'n rrrambl'n fer th' Web be tiresome. WYSIWYG editors help alleviate this task, but they generally result 'n horr'ble code, or worse yet, ugly web planks.
Marrrkdown be a better way t' write HTML, without all th' complexities an' ugliness that usually accompanies it.
Some o' th' key benefits be:
John Gruber, th' author o' Marrrkdown, puts it like this:
Th' overrid'n design goal fer Markdown’s formatt'n rules be t' make it as read'ble as poss'ble. Th' idea be that a Markdown-formatted document should be publish'ble as-is, as plain text, without look'n like it’s been marked up wit' tags or formatt'n instruct'ns. While Markdown’s rules has been influenced by several exist'n text-to-HTML filters, th' single biggest source o' inspirat'n fer Markdown’s rules be th' format o' plain text email. John Gruber
Without further delay, let us go over th' main elements o' Marrrkdown an' what th' result'n HTML looks like:
Bookmark this plank an' th' official Commonmark reference fer easy future reference!
Head'ns from h1
through h6
be constructed wit' a #
fer each level:
# h1 Head'n
## h2 Head'n
### h3 Head'n
#### h4 Head'n
##### h5 Head'n
###### h6 Head'n
Renders t':
HTML:
<h1>h1 Head'n</h1>
<h2>h2 Head'n</h2>
<h3>h3 Head'n</h3>
<h4>h4 Head'n</h4>
<h5>h5 Head'n</h5>
<h6>h6 Head'n</h6>
Comments should be HTML compat'ble
<!--
This be a comment
-->
Comment below should NOT be seen:
Th' HTML <hr>
element be fer creat'n a “thematic break” between paragraph-level elements. In Marrrkdown, ye can create a <hr>
wit' ---
- three consecutive dashes
renders t':
Any text not start'n wit' a special sign be written as normal, plain text an' will be wrapped within <p></p>
tags 'n th' rendered HTML.
So this body copy:
Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.
renders t' this HTML:
<p>Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.</p>
For emphasiz'n a snippet o' text wit' a heavier font-weight.
Th' follow'n snippet o' text be rendered as bold text.
**rendered as bold text**
renders t':
rendered as bold text
an' this HTML
<strong>rendered as bold text</strong>
For emphasiz'n a snippet o' text wit' italics.
Th' follow'n snippet o' text be rendered as italicized text.
_rendered as italicized text_
renders t':
rendered as italicized text
an' this HTML:
<em>rendered as italicized text</em>
In GFM (GitHub flavored Markdown) ye can do strikethroughs.
~~Strike through this text.~~
Which renders t':
Strike through this text.
HTML:
<del>Strike through this text.</del>
For quot'n blocks o' rrrambl'n from another source within yer document.
Add >
before any text ye want t' quote.
> **Fusion Drive** combines a hard drive wit' a flash storage (solid-state drive) an' presents it as a single logical volume wit' th' space o' both drives combined.
Renders t':
Fusion Drive combines a hard drive wit' a flash storage (solid-state drive) an' presents it as a single logical volume wit' th' space o' both drives combined.
an' this HTML:
<blockquote>
<p><strong>Fusion Drive</strong> combines a hard drive wit' a flash storage (solid-state drive) an' presents it as a single logical volume wit' th' space o' both drives combined.</p>
</blockquote>
Blockquotes can also be nested:
> Donec massa lacus, ultricies a ullamcorper 'n, fermentum sed augue. Nunc augue augue, aliquam non hendrerit ac, commodo vel nisi.
>
> > Sed adipisc'n elit vitae augue consectetur a gravida nunc vehicula. Donec auctor odio non est accumsan facilisis. Aliquam id turpis 'n dolor tincidunt mollis ac eu diam.
>
> Mauris sit amet ligula egestas, feugiat metus tincidunt, luctus libero. Donec congue finibus tempor. Vestibulum aliquet sollicitudin erat, ut aliquet purus posuere luctus.
Renders t':
Donec massa lacus, ultricies a ullamcorper 'n, fermentum sed augue. Nunc augue augue, aliquam non hendrerit ac, commodo vel nisi.
Sed adipisc'n elit vitae augue consectetur a gravida nunc vehicula. Donec auctor odio non est accumsan facilisis. Aliquam id turpis 'n dolor tincidunt mollis ac eu diam.
Mauris sit amet ligula egestas, feugiat metus tincidunt, luctus libero. Donec congue finibus tempor. Vestibulum aliquet sollicitudin erat, ut aliquet purus posuere luctus.
A list o' items 'n which th' order o' th' items does not explicitly matter.
Ye may use any o' th' follow'n symbols t' denote bullets fer each list item:
* valid bullet
- valid bullet
+ valid bullet
For example
+ Lorem ipsum dolor sit amet
+ Consectetur adipisc'n elit
+ Integer molestie lorem at massa
+ Facilisis 'n pretium nisl aliquet
+ Nulla volutpat aliquam velit
- Phasellus iaculis neque
- Purus sodales ultricies
- Vestibulum laoreet porttitor sem
- Ac tristique libero volutpat at
+ Faucibus porta lacus fringilla vel
+ Aenean sit amet erat nunc
+ Eget porttitor lorem
Renders t':
An' this HTML
<ul>
<li>Lorem ipsum dolor sit amet</li>
<li>Consectetur adipisc'n elit</li>
<li>Integer molestie lorem at massa</li>
<li>Facilisis 'n pretium nisl aliquet</li>
<li>Nulla volutpat aliquam velit
<ul>
<li>Phasellus iaculis neque</li>
<li>Purus sodales ultricies</li>
<li>Vestibulum laoreet porttitor sem</li>
<li>Ac tristique libero volutpat at</li>
</ul>
</li>
<li>Faucibus porta lacus fringilla vel</li>
<li>Aenean sit amet erat nunc</li>
<li>Eget porttitor lorem</li>
</ul>
A list o' items 'n which th' order o' items does explicitly matter.
1. Lorem ipsum dolor sit amet
4. Consectetur adipisc'n elit
2. Integer molestie lorem at massa
8. Facilisis 'n pretium nisl aliquet
4. Nulla volutpat aliquam velit
99. Faucibus porta lacus fringilla vel
21. Aenean sit amet erat nunc
6. Eget porttitor lorem
Renders t':
An' this HTML:
<ol>
<li>Lorem ipsum dolor sit amet</li>
<li>Consectetur adipisc'n elit</li>
<li>Integer molestie lorem at massa</li>
<li>Facilisis 'n pretium nisl aliquet</li>
<li>Nulla volutpat aliquam velit</li>
<li>Faucibus porta lacus fringilla vel</li>
<li>Aenean sit amet erat nunc</li>
<li>Eget porttitor lorem</li>
</ol>
If ye just use 1.
fer each number, Marrrkdown will automatically number each item. For example:
1. Lorem ipsum dolor sit amet
1. Consectetur adipisc'n elit
1. Integer molestie lorem at massa
1. Facilisis 'n pretium nisl aliquet
1. Nulla volutpat aliquam velit
1. Faucibus porta lacus fringilla vel
1. Aenean sit amet erat nunc
1. Eget porttitor lorem
Renders t':
Wrap inline snippets o' code wit' `
.
In this example, `<div></div>` should be wrapped as **code**.
Renders t':
In this example, <div></div>
should be wrapped as code.
HTML:
<p>In this example, <code><div></div></code> should be wrapped as <strong>code</strong>.</p>
Or indent several lines o' code by at least two spaces, as 'n:
// Some comments
line 1 o' code
line 2 o' code
line 3 o' code
Renders t':
// Some comments
line 1 o' code
line 2 o' code
line 3 o' code
HTML:
<pre>
<code>
// Some comments
line 1 o' code
line 2 o' code
line 3 o' code
</code>
</pre>
Use “fences” ```
t' block 'n multiple lines o' code.
```
Sample text here...
```
HTML:
<pre>
<code>Sample text here...</code>
</pre>
GFM, or “GitHub Flavored Markdown” also supports rules highlight'n. T' activate it, usually ye simply add th' file extension o' th' language ye want t' use directly aft th' first code “fence”, ```js
, an' rules highlight'n will automatically be applied 'n th' rendered HTML.
See Code Highlight'n fer additional documentat'n.
For example, t' apply rules highlight'n t' JavaScript code:
```js
grunt.initConfig({
assemble: {
opt'ns: {
assets: 'docs/assets',
data: 'src/data/*.{json,yml}',
helpers: 'src/custom-helpers.js',
partials: ['src/partials/**/*.{hbs,md}']
},
planks: {
opt'ns: {
layout: 'default.hbs'
},
files: {
'./': ['src/templates/pages/index.hbs']
}
}
}
};
```
Renders t':
grunt.initConfig({
assemble: {
opt'ns: {
assets: 'docs/assets',
data: 'src/data/*.{json,yml}',
helpers: 'src/custom-helpers.js',
partials: ['src/partials/**/*.{hbs,md}']
},
planks: {
opt'ns: {
layout: 'default.hbs'
},
files: {
'./': ['src/templates/pages/index.hbs']
}
}
}
};
Tables be created by add'n pipes as dividers between each cell, an' by add'n a line o' dashes (also separated by bars) beneath th' header. Avast that th' pipes do not need t' be vertically aligned.
| Opt'n | Descript'n |
| ------ | ----------- |
| data | path t' data files t' supply th' data that will be passed into templates. |
| engine | engine t' be used fer process'n templates. Handlebars be th' default. |
| ext | extension t' be used fer dest files. |
Renders t':
Opt'n | Descript'n |
---|---|
data | path t' data files t' supply th' data that will be passed into templates. |
engine | engine t' be used fer process'n templates. Handlebars be th' default. |
ext | extension t' be used fer dest files. |
An' this HTML:
<t'ble>
<tr>
<th>Opt'n</th>
<th>Descript'n</th>
</tr>
<tr>
<td>data</td>
<td>path t' data files t' supply th' data that will be passed into templates.</td>
</tr>
<tr>
<td>engine</td>
<td>engine t' be used fer process'n templates. Handlebars be th' default.</td>
</tr>
<tr>
<td>ext</td>
<td>extension t' be used fer dest files.</td>
</tr>
</t'ble>
Add'n a colon on th' right side o' th' dashes below any head'n will right align text fer that column.
| Opt'n | Descript'n |
| ------:| -----------:|
| data | path t' data files t' supply th' data that will be passed into templates. |
| engine | engine t' be used fer process'n templates. Handlebars be th' default. |
| ext | extension t' be used fer dest files. |
Opt'n | Descript'n |
---|---|
data | path t' data files t' supply th' data that will be passed into templates. |
engine | engine t' be used fer process'n templates. Handlebars be th' default. |
ext | extension t' be used fer dest files. |
Opt'n | Descript'n |
---|---|
ext | extension t' be used fer dest files. |
Opt'n | Descript'n |
---|---|
ext | extension t' be used fer dest files. |
[Assemble](http://assemble.io)
Renders t' (hover over th' link, there be no tooltip):
HTML:
<a href="http://assemble.io">Assemble</a>
[Upstage](https://github.com/upstage/ "Visit Upstage!")
Renders t' (hover over th' link, there should be a tooltip):
HTML:
<a href="https://github.com/upstage/" title="Visit Upstage!">Upstage</a>
Named anchors en'ble ye t' jump t' th' specified anchor point on th' same plank. For example, each o' these chapters:
# T'ble o' Contents
* [Chapter 1](#chapter-1)
* [Chapter 2](#chapter-2)
* [Chapter 3](#chapter-3)
will jump t' these sections:
## Chapter 1 <a id="chapter-1"></a>
Rrrambl'n fer chapter one.
## Chapter 2 <a id="chapter-2"></a>
Rrrambl'n fer chapter one.
## Chapter 3 <a id="chapter-3"></a>
Rrrambl'n fer chapter one.
NOTE that specific placement o' th' anchor tag seems t' be arbitrary. They be placed inline here since it seems t' be unobtrusive, an' it works.
Images have a similar rules t' links but include a preced'n exclamat'n point.
![Minion](https://octodex.github.com/images/minion.png)
or
![Alt text](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")
Like links, Images also have a footnote style rules
![Alt text][id]
Wit' a reference later 'n th' document defin'n th' URL locat'n:
[id]: https://octodex.github.com/images/dojocat.jpg "The Dojocat"
Th' Cap'n Hugo Marrrkdown parser supports additional non-standard functionality.
Add HTTP parameters width
and/or height
t' th' link image t' resize th' image. Values be CSS values (default be auto
).
![Minion](https://octodex.github.com/images/minion.png?width=20pc)
![Minion](https://octodex.github.com/images/minion.png?height=50px)
![Minion](https://octodex.github.com/images/minion.png?height=50px&width=300px)
Add a HTTP classes
parameter t' th' link image t' add CSS classes. shadow
an' border
be avail'ble but ye could define other ones.
![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?classes=shadow)
![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?classes=border)
![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?classes=border,shadow)
Add a HTTP featherlight
parameter t' th' link image t' dis'ble lightbox. By default lightbox be enabled us'n th' featherlight.js plugin. Ye can dis'ble this by defin'n featherlight
t' false
.
![Minion](https://octodex.github.com/images/minion.png?featherlight=false)
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' Relearrrn theme uses Hugo’s built-in rules highlight'n fer code.
Wrap th' code block wit' three backticks an' th' name o' th' language. Highlight will try t' auto detect th' language if one be not provided.
```json
[
{
"title": "apples",
"count": [12000, 20000],
"description": {"text": "...", "sensitive": false}
},
{
"title": "oranges",
"count": [17500, null],
"description": {"text": "...", "sensitive": false}
}
]
```
Renders t':
[
{
"title": "apples",
"count": [12000, 20000],
"description": {"text": "...", "sensitive": false}
},
{
"title": "oranges",
"count": [17500, null],
"description": {"text": "...", "sensitive": false}
}
]
Cap'n Hugo comes wit' a remark'ble list o' supported languages.
Ye can choose a color theme from th' list o' supported themes an' add it 'n yer config.toml
[marrrkup]
[marrrkup.highlight]
# if set t' `guessSyntax = true`, there will be no unstyled code even if no language
# was given BUT mermaid code fences will not work anymore! So this be a mandatory
# sett'n fer yer ship
guessSyntax = false
# choose a color theme or create yer own
style = "base16-snazzy"
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Ye can define additional menu entries or shortcuts 'n th' navigat'n menu without any link t' rrrambl'n.
Edit th' website configurat'n config.toml
an' add a [[menu.shortcuts]]
entry fer each link yer want t' add.
Example from th' current website:
[[menu.shortcuts]]
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "more/showcase/"
weight = 11
[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentation"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
url = "more/credits/"
weight = 30
[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-tags'></i> Tags"
url = "tags/"
weight = 40
By default, shortcuts be preceded by a title. This title can be disabled by sett'n disableShortcutsTitle=true
.
However, if ye want t' keep th' title but change its value, it can be overriden by chang'n yer local i18n translat'n str'n configurat'n.
For example, 'n yer local i18n/en.toml
file, add th' follow'n rrrambl'n
[Shortcuts-Title]
other = "<Your value>"
Read more about hugo menu an' hugo i18n translat'n str'ns
When us'n a multilingual website, ye can set different menus fer each language. In th' config.toml
file, prefix yer menu configurat'n by Languages.<language-id>
.
Example from th' current website:
[Languages]
[Languages.en]
title = "Hugo Relearrrn Theme"
weight = 1
languageName = "English"
landingPageURL = "/"
landingPageName = "<i class='fas fa-home'></i> Home"
[[Languages.en.menu.shortcuts]]
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "more/showcase/"
weight = 11
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentation"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
url = "more/credits/"
weight = 30
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-tags'></i> Tags"
url = "tags/"
weight = 40
[Languages.pir]
title = "Cap'n Hugo Relearrrn Theme"
weight = 1
languageName = "Arrr! Pirrrates"
landingPageURL = "/pir/"
landingPageName = "<i class='fas fa-home'></i> Arrr! Home"
[[Languages.pir.menu.shortcuts]]
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
[[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "more/showcase/"
weight = 11
[[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentat'n"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
[[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Crrredits"
url = "more/credits/"
weight = 30
[[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-tags'></i> Arrr! Tags"
url = "tags/"
weight = 40
Read more about hugo menu an' hugo multilingual menus
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' Relearrrn theme fer Cap'n Hugo loads th' Font Awesome library, allow'n ye t' easily display any ay'con or logo avail'ble 'n th' Font Awesome free collect'n.
Browse through th' avail'ble ay'cons 'n th' Font Awesome Gallery. Notice that th' free filter be enabled, as only th' free ay'cons be avail'ble by default.
Once on th' Font Awesome plank fer a specific ay'con, fer example th' plank fer th' heart, copy th' HTML reference an' paste into th' Marrrkdown rrrambl'n.
Th' HTML t' include th' heart ay'con be:
<i class="fas fa-heart"></i>
Paste th' <i>
HTML into marrrkup an' Font Awesome will board th' relevant ay'con.
Built wit' <i class="fas fa-heart"></i> by Relearrrn an' Cap'n Hugo
Which appears as
Built wit' by Relearrrn an' Cap'n Hugo
Font Awesome provides many ways t' modify th' ay'con
Check th' full documentat'n on web fonts wit' CSS fer more.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' Relearrrn theme be fully compat'ble wit' Cap'n Hugo multilingual mode.
It provides:
Aft learn'n how Cap'n Hugo handle multilingual websites, define yer languages 'n yer config.toml
file.
For example wit' current English an' Piratized English website.
# English be th' default language
defaultContentLanguage = "en"
[Languages]
[Languages.en]
title = "Hugo Relearrrn Theme"
weight = 1
languageName = "English"
[Languages.pir]
title = "Cap'n Hugo Relearrrn Theme"
weight = 2
languageName = "Arrr! Pirrrates"
Then, fer each new plank, append th' id o' th' language t' th' file.
my-page.md
be split 'n two files:
my-page.md
my-page.pir.md
_index.md
be split 'n two files:
_index.md
_index.pir.md
Be aware that only translated planks be displayed 'n menu. It’s not replaced wit' default language rrrambl'n.
Use slug Front Matter parameter t' translate urls too.
In case each page’s rrrambl'n be written 'n one single language only, th' above configurat'n will already configure th' site’s search functionality correctly.
Although th' theme supports a wide variety o' supported languages, th' site’s search does not. You’ll see error reports 'n yer browsers console log fer each unsupported language. Currently unsupported be:
In case yer page’s rrrambl'n contains text 'n multiple languages (e.g. ye be writ'n a russian documentat'n fer yer english API), ye can add those languages t' yer config.toml
t' broaden search.
[params]
additionalContentLanguage = [ "en" ]
As this be an array, ye can add multiple additional languages.
Keep 'n mind that th' language code required here, be th' base language code. E.g. if ye have additonal rrrambl'n 'n zh-CN
, ye have t' add just zh
t' this parameter.
Translat'ns str'ns be used fer common default values used 'n th' theme (Edit button, Search placeholder an' so on). Translat'ns be avail'ble 'n English an' Piratized English but ye may use another language or want t' override default values.
T' override these values, create a new file 'n yer local i18n folder i18n/<idlanguage>.toml
an' inspire yourself from th' theme themes/hugo-theme-relearn/i18n/en.toml
Switch'n th' language 'n th' browser be a great feature, but fer some reasons ye may want t' dis'ble it.
Just set disableLanguageSwitchingButton=true
'n yer config.toml
[params]
# When us'n mulitlingual website, dis'ble th' switch language button.
disableLanguageSwitchingButton = true
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' Relearrrn theme supports one default taxonomy o' Cap'n Hugo: th' tag feature.
Just add tags t' any plank:
+++
tags = ["tutorial", "theme"]
title = "Theme tutorial"
weight = 15
+++
Th' tags be displayed at th' top o' th' plank, 'n their insert'n order.
Each tag be a link t' a Taxonomy plank display'n all th' articles wit' th' given tag.
In th' config.toml
file ye can add a shortcut t' display all th' tags
[[menu.shortcuts]]
name = "<i class='fas fa-tags'></i> Tags"
url = "/tags"
weight = 30
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Cap'n Hugo uses Marrrkdown fer its simple rrrambl'n format. However, there be a lot o' th'ns that Marrrkdown doesn’t support well. Ye could use pure HTML t' expand possibilities.
But this happens t' be a bad idea. Everyone uses Marrrkdown because it’s pure an' simple t' read even non-rendered. Ye should avoid HTML t' keep it as simple as poss'ble.
T' avoid this limitat'ns, Cap'n Hugo created shorrrtcodes. A shorrrtcode be a simple snippet inside a plank.
Th' Relearrrn theme provides multiple shorrrtcodes on top o' exist'n ones.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' attachments
shorrrtcode displays a list o' files attached t' a plank wit' adjust'ble color, title an' ay'con.
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' also call this shorrrtcode from yer own partials.
{{% attachments sort="asc" /%}}
{{ partial "shortcodes/attachments.html" (dict
"context" .
"sort" "asc"
)}}
Th' shortcurt lists files found 'n a specific folder.
Currently, it supports two implementat'ns fer planks
If yer plank be a Marrrkdown file, attachements must be placed 'n a folder named like yer plank an' end'n wit' .files
.
- rrrambl'n
- _index.md
- plank.files
- attachment.pdf
- plank.md
If yer plank be a folder, attachements must be placed 'n a nested files
folder.
- rrrambl'n
- _index.md
- plank
- index.md
- files
- attachment.pdf
Be aware that if ye use a multilingual website, ye will need t' have as many folders as languages.
Name | Default | Notes |
---|---|---|
style | transparent |
Th' color scheme used t' highlight th' box rrrambl'n. - by severity: info , note , tip , warning <nd color: primary , secondary - by color: blue , green , grey , orange , red - by special color: default ,t` |
title | see notes | Arbitray text fer th' box title. Depend'n on th' style there may be a default title. Any given value will overwault. - fer severity styles: th' match'n title fer th' severity - fer all other colors: Attachments If ye wa ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces) |
ay'con | see notes | Font Awesome ay'con name set t' th' left o' th' title. Depend'n le** there may be a default ay'con. Any given value will overwrite th' default. - fer severity styles: a nice match'n iseverity - fer all other colors: paperclip If ye want no ay'con, ye have t' set this parameter t' " " (a non empty d wit' spaces) |
sort | asc |
Sort'n th' output 'n asc end'n or desc end'n order. |
pattern | .* |
A regular expressions, used t' filter th' attachments by file name. For example: - t' match a file suffix o' ‘jpg’, use .*jpg (not *.jpg )- t' match file names end'n 'n jpg or png , use .*(jpg|png) |
{{% attachments title="Related files" pattern=".*(pdf|mp4)" /%}}
{{% attachments style="info" sort="desc" /%}}
For further examples fer style, title an' ay'con, see th' notice
shorrrtcode documentat'n. Th' parameter be work'n th' same way fer both shorrrtcodes, besides hav'n different defaults.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' button
shorrrtcode displays a click'ble button wit' adjust'ble color, title an' ay'con.
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' also call this shorrrtcode from yer own partials.
{{% button href="https://gohugo.io/" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="warning" ay'con="dragon" %}}Get Cap'n Hugo{{% /button %}}
{{ partial "shortcodes/button.html" (dict
"context" .
"href" "https://gohugo.io/"
"content" "Get Hugo"
)}}
{{ partial "shortcodes/button.html" (dict
"context" .
"href" "https://gohugo.io/"
"style" "warning"
"icon" "dragon"
"content" "Get Hugo"
)}}
Once th' button be clicked, it opens another browser tab fer th' given URL.
Name | Default | Notes |
---|---|---|
href | <empty> | Th' destinat'n URL fer th' button. If this parameter be not set, th' button will do noth'n but be still displayed as click'ble. |
style | transparent |
Th' color scheme used t' paint th' button. - by severity: info , note , tip , warning - by brand color: primary , secondary - by color: blue , green , grey , orange , red - by special color: default , transparent |
ay'con | see notes | Font Awesome ay'con name set t' th' left o' th' title. Depend'n on th' style there may be a default ay'con. Any given value will overwrite th' default. - fer severity styles: a nice match'n ay'con fer th' severity - fer all other colors: <empty> If ye want no ay'con fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces) |
iconposit'n | left |
Places th' ay'con t' th' left or right o' th' title. |
<content> | see notes | Arbitray text fer th' button title. Depend'n on th' style there may be a default title. Any given value will overwrite th' default. - fer severity styles: th' match'n title fer th' severity - fer all other colors: <empty> If ye want no title fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces) |
{{% button href="https://gohugo.io/" style="info" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="note" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="tip" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="warning" %}}Get Cap'n Hugo{{% /button %}}
Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo
{{% button href="https://gohugo.io/" style="primary" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="secondary" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="blue" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="green" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="grey" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="orange" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="red" %}}Get Cap'n Hugo{{% /button %}}
Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo
{{% button href="https://gohugo.io/" style="default" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="transparent" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" ay'con="download" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" ay'con="download" iconposit'n="right" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" ay'con="dragon" style="warning" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="tip" %}}{{% /button %}}
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' children
shorrrtcode lists th' child planks o' a plank an' its descendants .
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' also call this shorrrtcode from yer own partials.
{{% children sort="weight" %}}
{{ partial "shortcodes/children.html" (dict
"context" .
"sort" "weight"
)}}
Name | Default | Notes |
---|---|---|
plank | <current> | Specify th' plank name (section name) t' display children fer. |
containerstyle | ul |
Choose th' style used t' group all children. It could be any HTML tag name. |
style | li |
Choose th' style used t' display each descendant. It could be any HTML tag name. |
showhidden | false |
When true , child planks hidden from th' menu will be displayed aswell. |
descript'n | false |
When true shows a short text under each plank 'n th' list. When no descript'n or summary exists fer th' plank, th' first 70 words o' th' rrrambl'n be taken - read more info about summaries on gohugo.io. |
depth | 1 |
Th' depth o' descendants t' display. For example, if th' value be 2 , th' shorrrtcode will display two levels o' child planks. T' get all descendants, set this value t' a high number eg. 999 . |
sort | see notes | Th' sort order o' th' displayed list. If not set it be sorted by th' ordersectionsby sett'n o' th' ship an' th' planks frontmatter- weight : t' sort on menu order- title : t' sort alphabetically on menu label. |
{{% children %}}
{{% children descript'n="true" %}}
{{% children depth="999" showhidden="true" %}}
{{% children containerstyle="div" style="h2" depth="3" descript'n="true" %}}
{{% children containerstyle="div" style="div" depth="3" %}}
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a plain demo child plank.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a demo child plank.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a demo child plank wit' a hidden child. Ye can still access th' hidden child directly or via th' search.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a plain demo child plank.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a plain demo child plank.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a plain demo child plank.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a plain demo child plank.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a demo child plank wit' no descript'n.
So its rrrambl'n be used as descript'n.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a demo child plank.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This be a plain demo child plank.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' expand
shorrrtcode displays an expandable/collaps'ble section o' text.
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' use positional aswell or also call this shorrrtcode from yer own partials.
{{% expand title="Expand me..." %}}Thank ye!{{% /expand %}}
{{% expand "Expand me..." %}}Thank ye!{{% /expand %}}
{{ partial "shortcodes/expand.html" (dict
"context" .
"title" "Expand me..."
"content" "Thank ye!"
)}}
Name | Posit'n | Default | Notes |
---|---|---|---|
title | 1 | "Expand me..." |
Arbitray text t' appear next t' th' expand/collapse ay'con. |
open | 2 | false |
When true th' rrrambl'n text will be initially shown as expanded. |
<content> | <empty> | Arbitray text t' be displayed on expand. |
{{% expand %}}Yes, ye did it!{{% /expand %}}
{{% expand title="Expand me..." open="true" %}}No need t' press ye!{{% /expand %}}
{{% expand title="Show me almost endless possibilities" %}}
Ye can add standard markdown rules:
- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** an' even **_bold emphasized_** text
- [links](https://example.com)
- etc.
```plaintext
...and even source code
```
> th' possiblities be endless (almost - includ'n other shorrrtcodes may or may not work)
{{% /expand %}}
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' include
shorrrtcode includes other files from yer project inside o' th' current plank.
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' use positional aswell or also call this shorrrtcode from yer own partials.
{{% include file="shortcodes/INCLUDE_ME.md" %}}
{{% include "shortcodes/INCLUDE_ME.md" %}}
{{ partial "shortcodes/include .html" (dict
"context" .
"file" "shortcodes/INCLUDE_ME.md"
)}}
Th' included files can even contain Marrrkdown an' will be taken into account when generat'n th' t'ble o' contents.
Name | Posit'n | Default | Notes |
---|---|---|---|
file | 1 | <empty> | Th' path t' th' file t' be included. Path resolut'n adheres t' Hugo’s build-in readFile funct'n |
hidefirsthead'n | 2 | false |
When true an' th' included file contains head'ns, th' first head'n will be hidden. This comes 'n handy, eg. if ye include otherwise standalone Marrrkdown files. |
{{% include "shortcodes/INCLUDE_ME.md" %}}
Ye can add standard markdown rules:
...and even source code
th' possiblities be endless (almost - includ'n other shorrrtcodes may or may not work) (almost - includ'n other shorrrtcodes may or may not work)
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Wit' th' Merrrmaid library an' shorrrtcode, ye can generate diagrams an' flowcharts from text, 'n a similar manner as Marrrkdown.
This only works 'n modern browsers.
Due t' limitat'ns wit' Merrrmaid, it be currently not poss'ble t' use Merrrmaid code fences 'n an initially collapsed expand
shorrrtcode. This be a know issue an' can’t be fixed by this theme.
While th' examples be us'n shorrrtcodes wit' named parameter it be recommended t' use codefences instead. This be because more an' more other software supports Merrrmaid codefences (eg. GitHub) an' so yer markdown becomes more port'ble.
Ye be free t' also call this shorrrtcode from yer own partials.
T' use codefence rules ye have t' turn off guessSyntax
fer th' marrrkup.highlight
sett'n (see th' configurat'n section).
```mermaid
graph LR;
If --> Then
Then --> Else
```
{{< mermaid >}}
graph LR;
If --> Then
Then --> Else
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
"context" .
"content" "graph LR;\nIf --> Then\nThen --> Else"
)}}
Th' generated graphs can be be panned by dragg'n them an' zoomed by us'n th' mousewheel. On mobile devices ye can use finger gestures.
Parameter be only supported when us'n shorrrtcode rules. Defaults be used when us'n codefence rules.
Name | Default | Notes |
---|---|---|
align | center |
Allowed values be left , center or right . |
<content> | <empty> | Yer mermaid graph. |
Merrrmaid be configured wit' default sett'ns. Ye can cust'mize Mermaid’s default sett'ns fer all o' yer files thru a JSON object 'n yer config.toml
, override these sett'ns per plank thru yer planks frontmatter or override these sett'n per diagramm thru diagram directives.
Th' JSON object o' yer config.toml
/ frontmatter be forwarded into Mermaid’s mermaid.initialize()
funct'n.
See Merrrmaid documentat'n fer all allowed sett'ns.
Th' theme
sett'n can also be set by yer used color variant. This will be th' sitewide default an' can - again - be overridden by yer sett'ns 'n config.toml
, frontmatter or diagram directives.
T' use codefence rules ye have t' turn off guessSyntax
fer th' marrrkup.highlight
sett'n.
[params]
mermaidInitialize = "{ \"theme\": \"dark\" }"
[marrrkup]
[marrrkup.highlight]
# if set t' `guessSyntax = true`, there will be no unstyled code even if no language
# was given BUT mermaid code fences will not work anymore! So this be a mandatory
# sett'n fer yer ship
guessSyntax = false
+++
mermaidInitialize = "{ \"theme\": \"dark\" }"
+++
{{< mermaid align="left" >}}
%%{init:{"theme":"forest"}}%%
graph LR;
A[Hard edge] -->|Link text| B(Round edge)
B --> C{<strong>Decision</strong>}
C -->|One| D[Result one]
C -->|Two| E[Result two]
{{< /mermaid >}}
{{< mermaid >}}
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how be ye?
loop Healthcheck
John->John: Fight against hypochondria
end
Avast right o' John: Rational thoughts <br/>prevail...
John-->Alice: Great!
John->Bob: How about ye?
Bob-->John: Jolly bloody!
{{< /mermaid >}}
{{< mermaid >}}
gantt
dateFormat YYYY-MM-DD
title Add'n GANTT diagram functionality t' Merrrmaid
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, aft des2, 5d
Future task2 : des4, aft des3, 5d
section Critical tasks
Completed task 'n th' critical line :crit, done, 2014-01-06,24h
Implement parser an' jison :crit, done, aft des1, 2d
Create tests fer parser :crit, active, 3d
Future task 'n critical line :crit, 5d
Create tests fer renderer :2d
Add t' Merrrmaid :1d
{{< /mermaid >}}
{{< mermaid >}}
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Whar' am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
{{< /mermaid >}}
```mermaid
stateDiagram-v2
open: Open Door
closed: Closed Door
locked: Locked Door
open --> closed: Close
closed --> locked: Lock
locked --> closed: Unlock
closed --> open: Open
```
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' notice
shorrrtcode shows various types o' disclaimers wit' adjust'ble color, title an' ay'con t' help ye structure yer plank.
It be all about th' boxes.
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' use positional aswell or also call this shorrrtcode from yer own partials.
{{% notice style="primary" title="There may be pirates" ay'con="skull-crossbones" %}}
It be all about th' boxes.
{{% /notice %}}
{{% notice primary "There may be pirates" "skull-crossbones" %}}
It be all about th' boxes.
{{% /notice %}}
{{ partial "shortcodes/notice.html" (dict
"context" .
"style" "primary"
"title" "There may be pirates"
"icon" "skull-crossbones"
"content" "It be all about th' boxes."
)}}
Name | Posit'n | Default | Notes |
---|---|---|---|
style | 1 | default |
Th' color scheme used t' highlight th' box rrrambl'n. - by severity: info , note , tip , warning - by brand color: primary , secondary - by color: blue , green , grey , orange , red - by special color: default , transparent |
title | 2 | see notes | Arbitray text fer th' box title. Depend'n on th' style there may be a default title. Any given value will overwrite th' default. - fer severity styles: th' match'n title fer th' severity - fer all other colors: <empty> If ye want no title fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces) |
ay'con | 3 | see notes | Font Awesome ay'con name set t' th' left o' th' title. Depend'n on th' style there may be a default ay'con. Any given value will overwrite th' default. - fer severity styles: a nice match'n ay'con fer th' severity - fer all other colors: <empty> If ye want no ay'con fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces) |
<content> | <empty> | Arbitray text t' be displayed 'n box. |
{{% notice style="info" %}}
An **informat'n** disclaimer
Ye can add standard markdown rules:
- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** an' even ***bold emphasized*** text
- [links](https://example.com)
- etc.
```plaintext
...and even source code
```
> th' possiblities be endless (almost - includ'n other shorrrtcodes may or may not work)
{{% /notice %}}
An informat'n disclaimer
Ye can add standard markdown rules:
...and even source code
th' possiblities be endless (almost - includ'n other shorrrtcodes may or may not work)
{{% notice style="note" %}}
A **notice** disclaimer
{{% /notice %}}
A notice disclaimer
{{% notice style="tip" %}}
A **tip** disclaimer
A tip disclaimer
{{% notice style="warning" %}}
A **warning** disclaimer
{{% /notice %}}
A warning disclaimer
{{% notice style="warning" title="Here be dragons" ay'con="dragon" %}}
A **warning** disclaimer
{{% /notice %}}
A warning disclaimer
{{% notice style="warning" title=" " ay'con=" " %}}
A **warning** disclaimer
{{% /notice %}}
A warning disclaimer
{{% notice style="primary" title="Primary" %}}
A **primary** disclaimer
{{% /notice %}}
A primary disclaimer
{{% notice style="secondary" ay'con="stopwatch" %}}
A **secondary** disclaimer
{{% /notice %}}
A secondary disclaimer
{{% notice style="blue" %}}
A **blue** disclaimer
{{% /notice %}}
A blue disclaimer
{{% notice style="green" title="Green" %}}
A **green** disclaimer
{{% /notice %}}
A green disclaimer
{{% notice style="grey" ay'con="bug" %}}
A **grey** disclaimer
{{% /notice %}}
A grey disclaimer
{{% notice style="orange" title="Orange" ay'con="bug" %}}
A **orange** disclaimer
{{% /notice %}}
A orange disclaimer
{{% notice style="red" %}}
A **red** disclaimer
{{% /notice %}}
A red disclaimer
{{% notice style="default" title"Pay Attent'n t' this Avast!" ay'con="skull-crossbones" %}}
Some serious informat'n.
{{% /notice %}}
Some serious informat'n.
{{% notice style="transparent" title"Pay Attent'n t' this Avast!" ay'con="skull-crossbones" %}}
Some serious informat'n.
{{% /notice %}}
Some serious informat'n.
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' siteparam
shorrrtcode prints values o' ship params.
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' use positional aswell or call this shorrrtcode from yer own partials.
{{% siteparam name="editURL" %}}
{{% siteparam "editURL" %}}
{{ partial "shortcodes/siteparam.html" (dict
"context" .
"name" "editURL"
)}}
Name | Posit'n | Default | Notes |
---|---|---|---|
name | 1 | <empty> | Th' name o' th' ship param t' be displayed. |
editURL
from config.toml
`editURL` value: {{% siteparam name="editURL" %}}
editURL
value: https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
This shorrrtcode uses th' RapiDoc library t' display yer Swagger / OpenAPI Specificat'ns.
This only works 'n modern browsers.
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' also call this shorrrtcode from yer own partials.
{{< swagger src="https://petstore3.swagger.io/api/v3/openapi.json" >}}
{{ partial "shortcodes/swagger.html" (dict
"context" .
"src" "https://petstore3.swagger.io/api/v3/openapi.json"
)}}
Name | Default | Notes |
---|---|---|
src | <empty> | Th' URL t' th' OpenAPI Specificat'n file. This can be relative t' th' URL o' yer plank if it be a leaf or branch bundle. |
Swagger be configured wit' default sett'ns. Ye can cust'mize Swagger’s default sett'ns fer all o' yer files thru a JSON object 'n yer config.toml
or override these sett'ns per plank thru yer planks frontmatter.
Th' JSON object o' yer config.toml
/ frontmatter be forwarded into Swagger’s initializat'n. At th' moment, only th' theme
sett'n be supported.
Th' theme
sett'n can also be set by yer used color variant. This will be th' sitewide default an' can - again - be overridden by yer sett'ns 'n config.toml
or frontmatter.
[params]
swaggerInitialize = "{ \"theme\": \"dark\" }"
{{< swagger src="petstore.json" >}}
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Th' tabs
shorrrtcode displays arbitrary rrrambl'n 'n unlimited number o' tabs. This comes 'n handy eg. fer provid'n code snippets fer multiple languages or provid'n configurat'n 'n different formats.
print("Hello World!")
echo "Hello World!"
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' also call this shorrrtcode from yer own partials.
{{< tabs >}}
{{% tab name="python" %}}
```python
print("Hello World!")
```
{{% /tab %}}
{{% tab name="bash" %}}
```bash
echo "Hello World!"
```
{{% /tab %}}
{{< /tabs >}}
{{ partial "shortcodes/tabs.html" (dict
"context" .
"tabs" (slice
(dict
"name" "python"
"content" ("```python\nprint(\"Hello World!\")\n```" | markdownify)
)
(dict
"name" "bash"
"content" ("```bash\necho \"Hello World!\"\n```" | markdownify)
)
)
)}}
Name | Default | Notes |
---|---|---|
groupid | default |
Arbitrary name o' th' group th' tab view belongs t'. Tab views wit' th' same groupid sychr'nize their selected tab. This sychronizat'n applies t' th' whole ship! |
<content> | <empty> | Arbitrary number o' tabs defined wit' th' tab sub-shortcode. |
When us'n tab views wit' different rrrambl'n sets, make sure t' use a common groupid
fer equal sets o' tabs but distinct groupid
fer different sets.
Th' tab select'n be restored automatically based on th' groupid
an' if it cannot find a tab item because it came from th' 'default'
group on a different plank then th' first tab be selected instead.
groupid
{{< tabs groupid="config" >}}
{{% tab name="json" %}}
```json
{
"Hello": "World"
}
```
{{% /tab %}}
{{% tab name="XML" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{% tab name="properties" %}}
```properties
Hello = World
```
{{% /tab %}}
{{< /tabs >}}
{
"Hello": "World"
}
<Hello>World</Hello>
Hello = World
groupid
See what happens t' this tab view if ye select properties tab from th' previous example.
{{< tabs groupid="config" >}}
{{% tab name="json" %}}
```json
{
"Hello": "World"
}
```
{{% /tab %}}
{{% tab name="XML" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{< /tabs >}}
{
"Hello": "World"
}
<Hello>World</Hello>