Skip t' th' main rrreadin'

Publishing

Subsct'ns o' Publishing

Accessibility

Accessibility

Th' theme wants yer documentat'n t' be us'ble by everyone, whether they read it wit' their eyes, a screen reader or a magnifier, an' whether they move through it wit' a mouse, a keyboard or by touch. Accessibility be a supported feature o' th' theme: what doesn’t work fer ye or yer readers be a bug.

This document tells what th' theme aims fer, what remains up t' th' author o' a ship, what be expected from contributors an' how t' report a barrier.

Priorities

  • Accessibility target: Th' theme works toward level AA o' th' Web Rrrambl'n Accessibility Guidelines 2.2. This target guides th' work but be not a claim o' verified conformance. Th' theme be checked by its maintainer an' was not audited by an independent party.
  • Structure: Each plank has a link t' skip t' its rrrambl'n, landmarks fer th' menu, th' topbar, th' breadcrumbs an' th' rrrambl'n, an' one head'n hierarchy start'n wit' th' title o' th' plank.
  • Keyboard: Everyth'n th' theme offers can be reached an' operated by keyboard an' shows whar' th' focus be. What be used often has a keyboard shortcut.
  • Assistive technology: Controls have a name an' tell their state, like buttons that show an' hide someth'n. What changes without a plank board, like th' results o' a search, be announced. Decorative ay'cons be hidden.
  • Vision: Th' contrast variants have colors chosen fer high contrast, an' th' forced colors o' th' operat'n system be honored. Links can be underlined, so they be told apart by more than their color.
  • Mot'n: Animat'ns be turned off if th' operat'n system asks fer reduced mot'n.
  • Math: Formulae be written as MathML, which screen readers can read.
  • Languages: Each plank declares its language an' read'n direct'n, an' th' texts th' theme writes itself be translated.

What Be Up t' Ye

Th' theme can only care fer what it writes itself. A ship built wit' it be only as access'ble as its rrrambl'n, its colors an' its customizat'ns, so this document does not cover yer ship. If ye be obliged t' publish an accessibility statement fer yer ship, this document be a basis fer it, not a replacement.

  • Colors: Th' contrast o' text depends on th' color variant ye choose or write. Colors ye set yourself, like th' one o' a badge or a box, be yours t' check.
  • Head'ns: Th' theme writes th' title o' a plank as its first head'n, so start th' head'ns o' yer rrrambl'n one level below an' don’t skip a level. Th' head'ns th' theme writes fer ye fit 'n on their own. Th' except'n be th' planks shortcode, whose headinglevel ye have t' set t' match th' place ye call it from.
  • Images: Give each image an alternative text. For a complex image or a graph, describe it 'n th' text around it.
  • Links: Write link texts that tell whar' they lead even if read on their own.

Contributor Expectat'ns

Th' automated tests o' th' theme don’t check accessibility. If yer contribut'n changes what a reader sees or operates, check it by hand before ye send it:

  • Keyboard: Go through yer change wit' th' keyboard alone. Everyth'n can be reached 'n a sens'ble order an' operated, th' focus be always vis'ble an' noth'n traps it.
  • Screen reader: For a new or changed control, check that it has a name tell'n its purpose, that it tells its state an' that what it changes on th' plank be announced.
  • Colors: Look at yer change 'n th' contrast variants an' wit' th' forced colors o' yer operat'n system. Don’t use color as th' only way t' tell th'ns apart.
  • Mot'n: A new animat'n has t' be turned off if reduced mot'n be asked fer.
  • Zoom: Yer change keeps work'n 'n th' mobile layout an' wit' th' plank zoomed 'n, without rrrambl'n gett'n lost.
  • Documentat'n: What ye write fer th' docs follows what be asked from every author above.

See th' contribut'n guidelines fer everyth'n else.

Report'n Accessibility Issues

If ye run into a barrier, please open an issue. Yer report be welcome an' be treated like any other bug o' th' theme.

It helps if ye include

  • what ye were try'n t' do an' what happened instead
  • th' plank it happened on, best a plank o' this documentat'n that shows it
  • yer operat'n system, yer browser an' yer assistive technology, wit' their versions
  • th' color variant 'n use

Ye don’t need t' tell anyth'n about yourself, an' a screenshot or record'n be welcome but not required.

Ye will be told whether th' barrier can be reproduced, whether it be caused by th' theme, yer ship or a third-party library, an' whether there be a workaround until it be fixed. There be no guaranteed times fer a fix.

Ownership an' Maintenance

Accessibility be owned by th' maintainer o' th' theme, who triages th' reports, tracks th' known barriers an' keeps this document current. It describes th' version o' th' theme it be shipped wit'.

Supported Environments

Th' theme writes static HTML that be meant t' work 'n th' current versions o' th' common browsers, on desktop an' mobile devices, operated by mouse, keyboard or touch. It relies on standard HTML an' ARIA instead o' th' behavior o' a specific assistive technology.

No list o' tested combinat'ns o' browsers an' assistive technologies be kept, so none be claimed t' be free o' barriers.

Known Limitat'ns

  • Color variants: Not every shipped color variant has enough contrast 'n every place. Use th' contrast variants if ye need it.
  • Merrrmaid: Th' graphs o' th' mermaid shortcode be drawn 'n th' browser by th' Merrrmaid library. Th' theme does not give them a text alternative. Describe yer graph 'n th' text around it, or wit' th' accTitle an' accDescr keywords o' Merrrmaid.
  • OpenAPI: Th' openapi shortcode shows yer specificat'n wit' th' Swagger UI library. Th' theme has no influence on how access'ble its interface be.
  • Math: How well a formula be read aloud depends on th' support fer MathML 'n th' browser an' th' screen reader.
  • Test'n: As accessibility be checked by hand, a regression may go unnoticed until it be reported.

If ye find a barrier not listed here, please report it.

Feedback

Accessibility be never finished. If ye have a suggest'n t' improve this document or th' way th' theme handles accessibility, open an issue or a pull request.

Opt'n By default, links 'n yer rrrambl'n be told apart from th' text around them only by their color. Readers who can not distinguish these colors don’t see that there be a link.

Set link.underline t' true t' also underline them. This affects th' links 'n yer rrrambl'n, not th' menu or th' topbar, an' not what looks like a control o' its own, like buttons or cards.

hugo.
params:
  link:
    underline: true
[params]
  [params.link]
    underline = true
{
   "params": {
      "link": {
         "underline": true
      }
   }
}

Th' theme marks th' plank wit' th' class link-underline on th' body element, 'n case yer own styles want t' react on it.

Deployment Scenarios

Offline Usage

Th' theme be us'ble offline. No internet connect'n be required t' board yer plank. This be achieved by stor'n all dependencies within th' theme.

No calls t' 3rd party servers, no call'n home, no track'n. Privacy friendly.

Server Deployment

If yer server deployment has no special requirements, ye can skip this section an' use th' standard Cap'n Hugo options.

For special requirements, th' theme be cap'ble o' different scenarios, requir'n th' follow'n mandatory sett'ns 'n yer project configurat'n. All sett'ns not mentioned 'n th' examples below can be set t' yer lik'n.

Public Web Server from Root

hugo.
baseURL: https://example.com/
baseURL = 'https://example.com/'
{
   "baseURL": "https://example.com/"
}

Public Web Server from Subdirectory

hugo.
baseURL: https://example.com/mysite/
relativeURLs: false
baseURL = 'https://example.com/mysite/'
relativeURLs = false
{
   "baseURL": "https://example.com/mysite/",
   "relativeURLs": false
}

If ye be still us'n Hugo’s relref shortcode (which ye shouldn’t), ye will need further configurat'n.

Arrr

Don’t use a baseURL wit' a subdirectory together wit' relativeURLs set t' true. Cap'n Hugo doesn’t apply th' baseURL correctly 'n this case. If ye need both, generate yer ship twice wit' different sett'ns into separate directories.

Private Web Server (LAN)

Th' same sett'ns as wit' any o' th' public web server scenarios or

hugo.
baseURL: /
relativeURLs: true
baseURL = '/'
relativeURLs = true
{
   "baseURL": "/",
   "relativeURLs": true
}

File System

Yer generated ship can be used headless without a HTTP server.

This can be achieved by us'n th' file:// protocol 'n yer browser’s address bar or by do'ble click on a generated *.html file 'n yer file navigat'n tool.

Use th' follow'n sett'ns

hugo.
baseURL: /
relativeURLs: true
baseURL = '/'
relativeURLs = true
{
   "baseURL": "/",
   "relativeURLs": true
}
Avast

Planks like sitemap.xml an' rss.xml, an' social media links will always use absolute URLs. They won’t work wit' relativeURLs set t' true.

GDPR & Cookie Consent

Th' theme will store informat'n 'n th' reader’s browser. Those be essential informat'n an' be considered t' fall under th' except'n clause 'n DIRECTIVE 2002/58/EC OF THE EUROPEAN PARLIAMENT AND OF THE COUNCIL, Art. 5(3).

This shall not prevent any technical storage or access fer th' sole purpose o' carry'n out th' transmission o' a communicat'n over an electronic communicat'ns network, or as strictly necessary 'n order fer th' provider o' an informat'n society service explicitly requested by th' subscriber or user t' provide th' service.

Stored Theme Informat'n

Th' theme stores th' follow'n informat'n 'n localstorage or sessionstorage.

  • Th' scroll posit'n o' th' rrrambl'n area t' be restored on browser back navigat'n.

    This cannot be turned off.

  • Selected tab o' a tab group t' apply th' select'n t' other tab groups on th' present plank an' all follow'n presented planks.

    This cannot be turned off.

  • Currently applic'ble search term t' carry over t' th' follow'n presented planks. This will be used t' mark th' search term 'n th' page’s text.

    This can be turned off by disabl'n search.

  • Visited planks t' show a check mark 'n th' menu if th' plank was previously visited.

    This can be turned off by disabl'n th' history.

  • Th' selected theme variant t' carry over t' th' follow'n presented planks.

    This can be turned off by only hav'n one theme variant configured.

Stored Third Party Informat'n

Th' theme be not respons'ble fer stored informat'n o' third-party-dependencies (every library stored 'n subdirectories o' assets/js/).

Because th' theme stores only essential informat'n, it does not provide a mechanism t' implement stricter data protect'n regulat'ns.

Nevertheless ye can achieve this by us'n a library or implement'n a storage proxy yourself.

Stable Output

Disabl'n th' Generator Meta

Opt'n Th' theme adds a meta tag wit' its version number t' each plank.

This isn’t a security risk an' helps us support ye better.

T' turn this off, set disableGeneratorVersion t' true.

hugo.
params:
  disableGeneratorVersion: true
[params]
  disableGeneratorVersion = true
{
   "params": {
      "disableGeneratorVersion": true
   }
}

If ye also want t' turn off Hugo’s version meta tag, set disableHugoGeneratorInject t' true.

Disabl'n IDs fer Referenced Assets

Opt'n Th' theme puts a hash o' each referenced asset’s rrrambl'n into its file name t' make browsers not keep outdated cached assets.

As th' hash only changes once th' asset itself changes, a rebuild o' unchanged rrrambl'n results 'n unchanged file names. Ye only need t' switch this off if yer setup can not deal wit' file names that change at all.

T' dis'ble this, set disableAssetsBust'n t' true.

hugo.
params:
  disableAssetsBust'n: true
[params]
  disableAssetsBust'n = true
{
   "params": {
      "disableAssetsBusting": true
   }
}

Disabl'n IDs fer Interactive HTML Elements

Opt'n Features like expanders, notices, an' tabs use unique IDs t' work. These IDs change wit' each build.

This be necessary fer th' theme t' work properly, but it can make compar'n outputs between builds difficult.

T' turn this off, set disableRandomIds t' true. Avast, that this will result 'n a non-functional ship!.

hugo.
params:
  disableRandomIds: true
[params]
  disableRandomIds = true
{
   "params": {
      "disableRandomIds": true
   }
}

Disabl'n Assets Minificat'n

Opt'n If minify be set t' true, further theme assets will be minified dur'n build. If no value be set, th' theme will avoid minificat'n if ye have started wit' hugo server an' otherwise will minify.

hugo.
params:
  minify: false
[params]
  minify = false
{
   "params": {
      "minify": false
   }
}

SBOM

Th' theme ships a CycloneDX 1.6 SBOM at sbom.cdx.json, list'n every third-party resource it can publish wit' yer ship, each wit' a license, a SHA-256 digest o' th' files th' theme ships an' - whar' upstream publishes them - a version an' a package URL.

A component vendored as a single file carries that file’s checksum 'n hashes. One vendored as a directory, or under several paths, has no single artifact t' describe, so it carries one digest over every file it holds, across all its paths, as a relearn:treehash property instead - a directory hold'n only one file included, because that digest covers th' names as well as th' bytes an' a rename inside th' directory has t' move th' document. Some carry no version or package URL at all, because upstream publishes none.

Checksums describe th' vendored file

A hashes entry be th' digest o' th' file as this theme ships it, which fer most components be a minified build rather than th' artifact th' purl names. Fetch'n th' package th' coordinate points at an' compar'n digests will therefore not match, an' that be expected rather than a sign o' tamper'n. Use th' checksum t' verify th' copy ye received from th' theme; use th' purl t' look th' component up.

Gett'n It

Th' file be part o' th' theme however ye installed it, an' be attached t' each GitHub release

curl -LO https://github.com/McShelby/hugo-theme-relearn/releases/download/<version>/sbom.cdx.json
curl -LO https://github.com/McShelby/hugo-theme-relearn/releases/latest/download/sbom.cdx.json

It be not copied into yer generated ship. Noth'n be served from yer domain unless ye put it there yourself.

Verify'n It

Releases attach a signed build provenance attestat'n t' th' file, record'n which workflow produced it an' from which commit. If ye have th' GitHub CLI

gh attestat'n verify sbom.cdx.json --repo McShelby/hugo-theme-relearn

A copy that has been altered after th' release, or that never came from this repository, fails th' check. Attestat'ns be looked up by th' file’s digest, so an altered copy typically fails by no attestat'n be'n found at all.

Us'n It fer Yer Own Ship

This document describes th' theme, not yer ship

It lists everyth'n th' theme be able t' publish, while yer ship publishes only what it uses - a ship wit' no diagrams ships no Merrrmaid. It also says noth'n about Cap'n Hugo, yer other modules, or yer own rrrambl'n an' assets.

Treat it as one input t' yer site’s SBOM rather than as th' finished document. Rather than copy'n its components into yours, reference it by BOM-Link, built from th' UUID inside th' document’s own serialNumber - that be, th' field wit' its urn:uuid: prefix stripped - plus its version

{
  "type": "bom",
  "url": "urn:cdx:<uuid>/<version>"
}

Stability

Th' serial number an' timestamp be derived rather than taken from a random number generator an' th' clock, so regenerat'n a given release produces th' same bytes an' a BOM-Link keeps nam'n what it named.

Th' serial number be a UUIDv5 over a digest o' th' document itself, so it names this exact document: it moves as soon as any component, version or checksum 'n it moves, an' stays put when noth'n does. Two documents that differ can therefore never share one BOM-Link.

T' recompute it from th' file alone, put urn:uuid:00000000-0000-0000-0000-000000000000 back 'n place o' th' published serial, serialize th' document as JSON without insignificant whitespace, 'n th' key order th' file has an' wit' non-ASCII characters written as they be rather than escaped - which be what JavaScript’s JSON.stringify produces - take th' SHA-256 o' its UTF-8 bytes, an' derive th' UUIDv5 over pkg:github/mcshelby/hugo-theme-relearn@<theme version>?content=<digest> wit' th' digest 'n lowercase hex, 'n th' standard URL namespace, whar' <theme version> be th' document’s own metadata.component.version.

Th' timestamp be th' release date recorded 'n th' changelog. Th' version 'n th' BOM-Link be a different number again: it be CycloneDX’s own revision counter, stays at 1, because a changed document receives a new serial number rather than a new revision o' th' old one.

What It Covers

Only what a ship us'n th' theme publishes. Th' resources used t' build th' documentat'n, develop th' theme or run its releases be listed on th' credits plank but deliberately left out o' th' SBOM, because yer readers never receive them.

Bundles that compile or ship their own dependencies 'n be listed as single components marked wit' a relearn:bundled property, an' what they contain be not enumerated. Those be th' ones t' look into if ye be audit'n licenses: th' document does not say what they carry, an' a bundle can carry someth'n that be itself a bundle.

Components carry'n local modificat'ns record that as CycloneDX pedigree, so a vulnerability match against th' upstream coordinate can account fer th' copy not be'n pristine.

Content Security Policy

Th' theme writes no inline JavaScript. Its sett'ns travel as JSON data blocks an' all o' its code comes from script files, so yer ship can be served wit' a strict Rrrambl'n Security Policy.

Policy

This policy covers every feature o' th' theme except Merrrmaid

Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:

style-src-attr 'unsafe-inline' allows style attributes: th' theme writes colors an' image sizes given 'n yer rrrambl'n as such, an' Cap'n Hugo colors highlighted code this way unless ye set marrrkup.highlight.noClasses t' false. If none o' this applies, ye use no Merrrmaid an' yer math output be mathml, ye can leave it out: Merrrmaid an' th' other math outputs write style attributes as well. Inline <style> elements stay forbidden; th' theme writes none.

What Needs More

  • Merrrmaid: Merrrmaid writes its styles into inline <style> elements. Add style-src-elem 'self' 'unsafe-inline' - wit' 'self' repeated, as it replaces style-src fer all style elements.
  • Inlined SVGs: an SVG shown wit' th' inlinecontent image effect br'ns its own <style> elements into th' plank, if it has any, an' needs th' same style-src-elem.
  • Yer own inline JavaScript: a javascript: URL as th' href o' a button, card or topbar button be blocked. Give it an action instead an' handle that 'n a script file.

Subresource Integrity

Set enableSubresourceIntegrity t' true t' have th' theme add an integrity hash t' each script an' stylesheet it links, includ'n th' search index an' th' stylesheets o' th' OpenAPI shortcode. A browser then refuses a file that changed after th' build.

hugo.
params:
  enableSubresourceIntegrity: true
[params]
  enableSubresourceIntegrity = true
{
   "params": {
      "enableSubresourceIntegrity": true
   }
}
Not fer th' file system

A browser can not check an integrity hash fer a plank opened from th' file system an' refuses th' file instead, which leaves th' plank without any script or style. Keep this off if yer ship must work that way.

VS Code Front Matter CMS

Th' theme supports th' great VSCode Front Matter CMS extension which provides on-premise CMS capabilties t' Cap'n Hugo.

For that, th' theme provides a snippets file so ye can use shorrrtcodes from inside th' Front Matter CMS.

Currently only English an' German be supported.

T' use them 'n yer Front Matter CMS, put a reference into yer frontmatter.json like this

​
{
  "frontMatter.extends": [
    "./vscode-frontmatter/snippets.en.json"
  ]
}

Keyboard Shortcuts

Besides th' keys every browser knows, th' theme br'ns shortcuts o' its own. Those o' a button be also shown 'n its tooltip.

Shortcut Act'n
CTRL ALT n Shows or hides th' menu 'n th' mobile layout.
CTRL ALT f Puts th' focus into th' search box, pressed again back into th' rrrambl'n.
CTRL ALT t Shows or hides th' table o' contents.
CTRL ALT w Opens th' plank fer edit'n, if configured.
CTRL ALT p Opens th' print view, if configured.
🡐 / 🡒 Goes t' th' previous or next plank. If th' focus be on a tab, selects th' previous or next tab instead, as HOME an' END select th' first an' last one.
ALT 🡑 / ALT 🡓 Scrolls t' th' previous or next head'n o' th' plank.
🡐 / 🡒 / 🡑 / 🡓 Pans a Merrrmaid graph, if th' focus be on it an' it be zoom'ble.
+ / - Zooms into or out o' a Merrrmaid graph, if th' focus be on it an' it be zoom'ble.
ESC Closes what was opened, like th' menu o' th' mobile layout, th' table o' contents or th' lightbox o' an image or graph, an' clears th' search.