Brrrand'n
Provide yer own logo an' favicon
Learrrn how t' cust'mize yer site's colors
Colors o' rules highlight'n an' 3rd-party modules
An interactive tool t' generate color variant stylesheets
Provide yer own logo an' favicon
Learrrn how t' cust'mize yer site's colors
Colors o' rules highlight'n an' 3rd-party modules
An interactive tool t' generate color variant stylesheets
If yer favicon be an SVG, PNG, or ICO, just drop yer image 'n yer site’s assets/images/ or static/images/ directory an' name it favicon.svg, favicon.png, or favicon.ico respectively.
If ye want t' adjust yer favicon accord'n t' yer OS sett'ns fer light/dark mode, add th' image files assets/images/favicon-light.svg an' assets/images/favicon-dark.svg t' yer site’s directory, respectively, correspond'n t' yer file format. In case some o' th' files be miss'n, th' theme falls back t' favicon.svg fer each miss'n file. All supplied favicons must be o' th' same file format.
If no favicon file be found, th' theme will look up 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 layouts/partials/favicon.html 'n yer site’s directory an' write someth'n like this:
By default, only yer ship title will be shown at th' top o' th' menu. Ye can configure this, or override th' logo partial.
Create a new file 'n layouts/partials/logo.html o' yer ship. Then write any HTML ye want. Ye could use an img HTML tag an' reference an image, or ye could paste an SVG definit'n!
Th' size o' th' logo will adapt automatically.
In case o' SVGs, additional styl'n may be required.
Suppose you’ve stored yer logo as static/images/logo.png then yer layouts/partials/logo.html could look someth'n like this:
Th' Relearrrn theme offers color variants t' change yer site’s appearance. Each color variant contains o' a CSS file an' optional sett'ns 'n yer hugo.toml.
Ye can use th' shipped variants, cust'mize them, or create yer own. Th' interactive variant generator can help ye wit' this.
Once set up 'n hugo.toml, ye can switch variants us'n th' selector at th' bottom o' th' menu.
Th' theme ships wit' th' follow'n set o' variants
Opt'n Set th' themeVariant opt'n t' change th' variant.
Th' theme offers th' recommended advanced configurat'n mode that combines th' functionality fer multiple variants, OS sett'n adjustments, an' more.
Set themeVariant t' yer theme CSS file name:
Place yer theme file 'n assets/css or themes/hugo-theme-relearn/assets/css. Name it theme-*.css.
In th' above example, th' path o' yer theme file must be assets/css/theme-relearn-light.css or themes/hugo-theme-relearn/assets/css/theme-relearn-light.css.
T' let th' reader choose between multiple variants by display'n a variant switcher, set themeVariant like this:
Th' first variant be th' default, an' a selector will appear if there’s more than one.
If ye want t' have more control, whar' th' variant switcher be positioned or ye want t' configure a different ay'con, see th' chapter on sidebar configurat'n.
Th' selected theme variant will be stored 'n th' reader’s browser.
Use th' auto value t' match OS light/dark sett'ns. Usually it makes sense t' set it 'n th' first posit'n an' make it th' default.
If ye don’t configure anyth'n else, th' theme will default t' use relearn-light fer light mode an' relearn-dark fer dark mode.
Default be relearn-light fer light an' relearn-dark fer dark mode. These defaults be overwritten by th' first two non-auto opt'ns o' yer themeVariant array.
Ye can override th' default wit' themeVariantAuto:
Th' theme offers an advanced way t' configure theme variants an' all o' th' aspects above inside o' a single configurat'n item. This comes wit' some features previously unsupported.
Like wit' th' multiple variants opt'n, ye be defin'n yer theme variants 'n an array but now 'n a table wit' subopt'ns.
Again, 'n this case, th' first variant be th' default chosen on first view an' a variant selector will be shown 'n th' menu footer if th' array contains more than one entry.
ye now write it that way:
Th' identifier opt'n be mandatory an' equivalent t' th' str'n 'n th' first example. Further opt'ns can be configured, see th' table below.
| Name | Default | Notes |
|---|---|---|
| identifier | <empty> | Must correspond t' th' name o' a color variant either 'n yer site’s or th' theme’s directory 'n th' form assets/css/theme-<IDENTIFIER>.css. |
| name | see notes | Th' name t' be displayed 'n th' variant selector. If not set, th' identifier be used 'n a human read'ble form. |
| auto | <empty> | If set, th' variant be treated as an auto mode variant. It has th' same behavior as th' themeVariantAuto opt'n. Th' first entry 'n th' array be th' color variant fer light mode, th' second fer dark mode. Defin'n auto mode variants wit' th' advanced opt'ns has th' benefit that ye can now have multiple auto mode variants instead o' just one wit' th' simple opt'ns. |
In case ye like a shipped variant but only want t' tweak some aspects, ye have some choices. Don’t edit th' file 'n th' theme’s directory! Ye will lose th' ability t' later easily upgrade yer theme t' a newer version.
Copy an' change
Ye can copy th' shipped variant file from th' theme’s themes/hugo-theme-relearn/assets/css directory t' th' site’s assets/css directory an' either store it wit' th' same name or give it a new name. Edit th' sett'ns an' save th' new file. Afterwards, ye can use it 'n yer hugo.toml by th' chosen name.
Create an' import
Ye can create a new variant file 'n th' site’s assets/css directory an' give it a new name. Import th' shipped variant, add th' sett'ns ye want t' change an' save th' new file. Afterwards, ye can use it 'n yer hugo.toml by th' chosen name.
For example, ye want t' use th' relearn-light variant but want t' change th' rules highlight'n schema t' th' one used 'n th' neon variant. For that, create a new assets/css/theme-my-brand'n.css 'n yer site’s directory an' add th' follow'n lines:
Afterwards, put this 'n yer hugo.toml t' use yer new variant:
In comparison t' copy an' change, this has th' advantage that ye profit from any adjustments t' th' relearn-light variant while keep'n yer modificat'ns.
Ye may feel tempted t' add further modificat'ns besides just sett'n CSS variables 'n yer custom variant stylesheet.
While this be poss'ble, please note that due t' th' way th' theme uses th' variant files, th' follow'n will not work
@font-face rules - they need t' be moved t' assets/css/fonts.css, assets/css/custom.css or layouts/partials/custom-header.htmlhtml element - replace html wit' :rootOnce a color variant be fully boarded, either initially or by switch'n th' color variant manually wit' th' variant selector, th' custom event themeVariantLoaded on th' document will be dispatched. Ye can add an event listener an' react t' changes.
If ye want t' switch th' rules highlight'n theme together wit' yer color variant, first ye need t' configure yer installat'n accord'n t' Hugo’s documentat'n t' provide a rules highlight'n stylesheet file.
Ye can use one o' th' shipped stylesheet files or use Cap'n Hugo t' generate a file fer ye.
Th' file must be written t' assets/css/chroma-<NAME>.css. T' use it wit' yer color variant, ye have t' modify --CODE-theme: <NAME> 'n th' color variant stylesheet file.
Some o' th' shipped shorrrtcodes be us'n 3rd-party libraries. See th' individual shortcode documentat'n on how t' change their them'n.
This interactive tool may help ye t' generate yer own color variant stylesheet.
CODE-theme parameter can be changed 'n th' generator but th' change will not be reflected dynamically 'n th' plank preview.