How To: Use Relearn Theme
Hugo Relearn Theme Support
DocBuilder includes built-in support for the Hugo Relearn theme, a documentation-focused theme with extensive features for technical documentation.
Features
The Relearn theme integration provides:
- Hugo Modules: Automatic theme installation via Hugo Modules (no manual theme setup required)
- Math Support: Built-in MathJax integration for mathematical and chemical formulae
- Mermaid Diagrams: Native support for Mermaid diagram rendering
- Search: Lunr.js-powered offline search
- Edit Links: Automatic “Edit this page” links to source repositories
- Customizable Appearance: Multiple color variants and dark mode support
- Responsive Design: Mobile-friendly layout
- Multilingual: Support for 20+ languages with RTL support
Quick Start
Basic Configuration
Advanced Configuration
Theme Variants
Relearn includes multiple built-in color schemes that can be configured in simple or advanced modes.
Shipped Variants
The theme ships with the following color variants:
Relearn Family:
relearn-light- Classic Relearn default with signature green, dark sidebar and light contentrelearn-dark- Dark variant with signature green, dark sidebar and dark contentrelearn-bright- Alternative with signature green, green sidebar and light content
Zen Family:
zen-light- Relaxed white/grey variant with blue accents, light sidebar and light contentzen-dark- Dark variant with blue accents, dark sidebar and dark content
Experimental:
neon- Glowing dark theme with gradient sidebar
Retro (Learn Theme):
learn- Original Learn theme with light purple, dark sidebar and light contentblue- Blue-tinted Learn themegreen- Green-tinted Learn themered- Red-tinted Learn theme
Simple Configuration
Single Variant
Use a single variant for your entire site:
Multiple Variants with Selector
Let users choose between variants via a switcher in the menu:
The first variant is the default. A variant selector appears automatically when multiple variants are configured.
Auto Mode (OS Light/Dark Detection)
Use auto to match the operating system’s light/dark preference:
By default, auto uses relearn-light for light mode and relearn-dark for dark mode. You can customize this:
Advanced Configuration
For more control over variant names, auto-mode behavior, and logos, use the advanced array format:
Advanced Parameters:
| Parameter | Required | Description |
|---|---|---|
identifier |
Yes | Name of the color variant (must match theme-<identifier>.css) |
name |
No | Display name in variant selector (defaults to identifier in human-readable form) |
auto |
No | Array of two variants: [light-mode, dark-mode] for OS detection |
logo |
No | Override the default logo for this variant |
Custom Variants
You can create custom variants by:
- Copy and modify: Copy a shipped variant from
themes/hugo-theme-relearn/assets/css/theme-*.cssto your site’sassets/css/directory - Import and extend: Create a new CSS file that imports a base variant and overrides specific variables
Example custom variant (assets/css/theme-my-brand.css):
Then use it in your config:
See the Relearn Color Documentation and Stylesheet Generator for more customization options.
Default Settings
DocBuilder automatically configures these defaults for Relearn:
| Parameter | Default | Description |
|---|---|---|
themeVariant |
["auto", "zen-light", "zen-dark"] |
Auto light/dark mode with variant selector |
themeVariantAuto |
["zen-light", "zen-dark"] |
OS light/dark mode fallbacks |
showVisitedLinks |
true |
Mark visited pages |
collapsibleMenu |
true |
Collapsible sidebar sections |
alwaysopen |
false |
Don’t force menu sections open |
disableBreadcrumb |
false |
Show breadcrumb navigation |
disableLandingPageButton |
true |
Hide landing page button |
disableShortcutsTitle |
false |
Show shortcuts menu in sidebar |
disableTagHiddenPages |
false |
Tag hidden pages |
disableGeneratorVersion |
false |
Show generator version in footer |
mermaid.enable |
true |
Enable Mermaid diagrams |
math.enable |
true |
Enable MathJax support |
Note: editURL is not set by default. Configure it manually if you want “Edit this page” links.
All defaults can be overridden in your configuration’s hugo.params section.
Hugo Module Configuration
DocBuilder uses Hugo Modules to automatically install Relearn. The theme is configured as:
- Module Path:
github.com/McShelby/hugo-theme-relearn - Version:
v8.3.0
No manual theme installation required - Hugo will download the theme on first build.
Content Structure
Relearn builds navigation from your content structure. Place an _index.md in each directory to create sections:
Shortcodes
Relearn includes many built-in shortcodes for rich content:
notice- Styled notice boxes (info, warning, tip, note)expand- Expandable content sectionstabsandtab- Tabbed contentbutton- Styled buttonsmermaid- Mermaid diagramsmath- Mathematical formulae
See Relearn Shortcodes Documentation for full list.
Troubleshooting
Theme Not Loading
Ensure Hugo is installed and run:
Search Not Working
Relearn search requires JavaScript. Ensure you’re viewing the built site (not raw markdown):
Edit Links Not Appearing
Verify your repository configuration includes the forge URL:
Resources
- Relearn Theme Documentation
- Relearn GitHub Repository
- Hugo Modules Documentation
- DocBuilder Configuration Reference
Why Relearn?
DocBuilder uses Relearn exclusively because it provides:
- Rich Documentation Features: Built-in search, navigation, breadcrumbs, and shortcuts
- Strong Multilingual Support: 20+ languages with full i18n capabilities
- Extensive Shortcodes: Notice boxes, tabs, buttons, diagrams, math - no plugins needed
- Math & Diagrams: MathJax and Mermaid built-in
- Excellent Mobile Support: Responsive design that works on all devices
- High Customizability: Theme variants, custom CSS, configurable layouts
- Low Learning Curve: Intuitive structure and clear documentation
- Active Maintenance: Regular updates and responsive community
Relearn strikes the optimal balance between features, ease of use, and maintenance burden for technical documentation.