Miscellaneous
Accessibility guidance and how to add custom CSS/JS assets.
Accessibility
General, framework-agnostic recommendations (adapted from upstream’s guidance, which applies just as well here):
- Color contrast — if you override
--pst-*color variables (see Styling ), check contrast ratios against WCAG AA, especially for both light and dark mode. - Keyboard navigation — the search dialog, theme switcher, and sidebar toggle are all keyboard-operable out of the box; if you add custom partials into any slot, keep them keyboard-accessible too.
- Logo alt text — always set
logo.alt_textwhen using an image logo (see Branding ) rather than relying on the fallback. - Sitemaps — Hugo generates a
sitemap.xmlautomatically for every build; no theme configuration or extension (unlike Sphinx’ssphinx_sitemap) is needed.
Static assets
If you’re coming from Sphinx: this theme’s extra_css param (see Styling
) is the direct equivalent of html_css_files. There’s no direct equivalent of html_js_files/app.add_js_file as a theme param — for custom JS, use Hugo’s own asset pipeline (Hugo Pipes
) at the site level: drop a script in your site’s assets/, process/fingerprint it with resources.Get/fingerprint in a site-level partial override, and add that partial to whichever slot you want it in (e.g. content_footer_items, footer_end).