azure-monitor-baseline-alerts / hugo-theme-relearn
CLAUDE.md322 starsChanged 11 months agoMITView on GitHub
Hugo Relearn Theme is a documentation theme for Hugo, forked from the Learn theme. It's designed for creating documentation sites with features like multilingual support, dark mode, search, print support, and extensive shortcodes. Minimum Hugo version required can be found in theme.toml. Development uses the docs for manual testing and documenting new features. Development uses the exampleSite for manual testing and providing a simple showcase. The goal is to keep configuration minimal and be a first starting point for new…
- Installs packages
In this repositoryOne other file it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
The file
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 128
Search files in assets/js/search*.js
- Very specific: line 129
Search index generated at build time via _relearn_searchindex.js
- Distinctive: line 145
Use conventional commit format.
- Distinctive: line 158
Stay close to Hugo: - Follow Hugo patterns and conventions
- Distinctive: line 159
No build tools: - Avoid npm/preprocessing for theme itself (contributors may not be front-end developers)
- Distinctive: line 161
Backwards compatibility: - Don't break existing features unless necessary
- Distinctive: line 162
Clean output: - Remove console errors, check HTML whitespace and indentation
- Distinctive: line 205
Test against the exampleSite which demonstrates all theme features.
- Distinctive: line 206
Search functionality (both Lunr and Orama)
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Overview
Hugo Relearn Theme is a documentation theme for Hugo, forked from the Learn theme. It's designed for creating documentation sites with features like multilingual support, dark mode, search, print support, and extensive shortcodes.
Minimum Hugo version required can be found in theme.toml.
Development Commands
Running the Theme
Development uses the docs for manual testing and documenting new features.
# Run the dev server from exampleSite directory
cd exampleSite
hugo server -p 1414Development uses the exampleSite for manual testing and providing a simple showcase. The goal is to keep configuration minimal and be a first starting point for new users.
# Run the dev server from exampleSite directory
cd exampleSite
hugo serverConfigurations
During development cycles, the server is started manually without an environment option.
The following other environments are available:
- testing - used to test the site during development using
test-hugo.bat - github - used to release the site on GitHub Pages
- dev - used to generate the site similar to GitHub Pages but usable locally
- performance - disables all performance intensive features to make building as fast as possible
- versioning - used to manually test the versioning feature
Building
# Build from docs
cd docs
hugo
# Build with minification (production)
hugo --minifyScreenshots Tool
# Generate screenshots using Puppeteer
cd tools
npm install
npm run screenshotsArchitecture
Directory Structure
- layouts/ - Hugo templates organized by type
- _default/ - Base layouts (baseof.html, single.html, list.html, etc.)
- partials/ - Reusable template partials
- _relearn/ - Core theme helper functions (.gotmpl files)
- shortcodes/ - Theme shortcodes (badge, button, card, tabs, mermaid, etc.)
- chapter/, home/ - Specialized page layouts
- assets/ - Source files processed by Hugo Pipes
- css/ - Stylesheets including theme variants and chroma syntax highlighting
- js/ - JavaScript modules (theme.js, search, clipboard, etc.)
- i18n/ - Translation files (.toml) for 26+ languages
- archetypes/ - Content templates (default.md, chapter.md, home.md)
- exampleSite/ - Full demo site used for development
- config/_default/ - Base configuration
- config/testing/, config/github/, etc. - Environment-specific configs
- docs/ - Documentation site source (separate from exampleSite)
- config/_default/ - Base configuration
- config/testing/, config/github/, etc. - Environment-specific configs
Key Template Concepts
Partials in layouts/partials/_relearn/:
.gotmplextension indicates Hugo template functions- Core utilities:
boxStyle,decoratedLink,imageAttributes,linkAttributes,menuObject,dependencies - These are helper functions, not rendered partials
Shortcodes:
- Highly modular - each shortcode in
layouts/shortcodes/ - Support both inline and block syntax
- Examples: badge, button, card/cards, expand, icon, include, math, mermaid, notice, openapi, tab/tabs, tree
Dependencies System:
- Theme uses a dependency loading system defined in
hugo.tomlunderparams.relearn.dependencies - Dependencies: Math, Mermaid, OpenApi, Search, Theme
- Loaded on-demand based on shortcode usage
Output Formats
Theme supports custom output formats:
- print - Printable versions of pages
- source - Markdown source view
- Define in
hugo.tomlunder[outputFormats]
Theming System
Color Variants:
- Multiple built-in variants in
assets/css/theme-*.css - Variants: relearn-light, relearn-dark, relearn-bright, learn, neon, blue, green, red, zen-light, zen-dark
- Users can switch variants via the topbar
- Base theme variables in
assets/css/variables.css
Chroma Syntax Highlighting:
- Separate chroma stylesheets for each variant:
chroma-*.css
Search Implementation
- Two search engines supported: Lunr and Orama
- Search files in
assets/js/search*.js - Search index generated at build time via
_relearn_searchindex.js
JavaScript Architecture
- theme.js - Main theme JavaScript
- Modular dependencies loaded from subdirectories:
auto-complete/- Search autocompleteclipboard/- Copy-to-clipboardlunr/,orama/- Search enginesmathjax/,mermaid/,d3/- Feature librariesperfect-scrollbar/- Scrollbar customization
Code Quality Standards
Commit Message Format
Use conventional commit format.
Common commit types:
- Common: build, browser, chore, docs, shortcodes, theme
- Features: a11y, archetypes, alias, generator, i18n, mobile, print, rss, variant
- Structure: favicon, search, menu, history, scrollbar, nav, toc, clipboard, syntaxhighlight, boxes
- Shortcodes: attachments, badge, button, children, expand, icon, include, math, mermaid, notice, openapi, piratify, siteparam, tabs
Example: search: improve Orama integration for multilingual sites
Development Principles
- Convention over configuration - Site should work with minimal configuration
- Stay close to Hugo - Follow Hugo patterns and conventions
- No build tools - Avoid npm/preprocessing for theme itself (contributors may not be front-end developers)
- Document features - New features require documentation and release notes entries
- Backwards compatibility - Don't break existing features unless necessary
- Clean output - Remove console errors, check HTML whitespace and indentation
Git Hooks
Python-based git hooks in .githooks/:
post-commit.py- Post-commit processingpre-push.py- Pre-push validation
Important Files
- hugo.toml - Theme configuration and module requirements
- theme.toml - Theme metadata (name, features, Hugo version)
- go.mod - Hugo module definition
- .prettierrc.json / .prettierignore - Code formatting (Prettier)
- .editorconfig - Editor configuration
- CHANGELOG.md - Detailed version history
Content Development
Front Matter
Standard front matter for content:
+++
title = "Page Title"
weight = 10 # Ordering in sidebar
+++Page Types
- Home - Site landing page (uses
layouts/home/) - Chapter - Section pages (uses
layouts/chapter/) - Default - Regular content pages
Multilingual Sites
- Translation files in
i18n/*.toml - Content organized by language code:
content/en/,content/de/, etc. - Set
defaultContentLanguagein hugo.toml
Testing
Test against the exampleSite which demonstrates all theme features. Verify:
- Search functionality (both Lunr and Orama)
- Print output
- Theme variant switching
- Shortcodes rendering
- Mobile responsiveness
- Multilingual navigation
- No console errors
Release Process
Releases happen directly from the main branch without prior notice. Every commit to main must be production-ready and result in a releasable version.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

