Overview of Hugo Relearn Theme
mainfile:// protocol.repository·main·Indexed 20 days ago
https://github.com/mcshelby/hugo-theme-relearnA highly customizable documentation theme for the Hugo static site generator and an enhanced fork of the Learn theme. It features RTL support, offline usability, a rich shortcode library (including Mermaid diagrams and OpenAPI rendering), and advanced content management with support for versioning, mixed-language search, and customizable page designs like home and chapter.
file:// protocol.reference and serves as a foundational guide for organizing content and understanding how the site is composed.The theme supports several GitHub Flavored Markdown (GFM) and Hugo Markdown extensions, including:
The theme supports languages written from right to left (e.g., Arabic). This support is implemented for the content area.
Limitations:
The style parameter determines the base theme application, while color provides a specific override.
info): Sets a theme-configured background color and a matching icon. If color is also provided, the background uses a lighter version of that specific CSS color instead of the theme's severity color.blue): Sets the background to a lighter version of the chosen color.style: "default" is used with a color, the background is set to your theme's --MAIN-BG-color but tinted with the chosen color.color is set (without a specific style), the background is a lighter version of that CSS color.{{% multishortcode name="tabs" %}}
content:
- title: "just colored style"
style: "blue"
content: "..."
- title: "just color"
color: "blue"
content: "..."
- title: "default style and color"
style: "default"
color: "blue"
content: "..."
- title: "just severity style"
style: "info"
content: "..."
- title: "severity style and color"
style: "info"
color: "blue"
content: "..."
{{% /multishortcode %}}The project follows Semantic Versioning (Semver). Release types are determined by the entries in the What's new page:
{{% badge style="breaking" %}}Breaking{{% /badge %}} entry.Entries on the What's new page are enforced by the version-release GitHub Action.
notice box contains only a single code block, the margin and border of that code block are automatically removed. This ensures that only the colored border of the notice box is visible, creating a cleaner integration between the code and the notice container.markdown output format. This format functions similarly to the print output format but allows users to view the raw Markdown source of a page. This is typically accessed via a button in the topbar.To customize the Relearn theme without modifying the core theme files, use Hugo's union file system. By placing files in your site's root directory that match the path of files within the themes/hugo-theme-relearn directory, your files will override the theme's defaults.
Example: Overriding a partial
To override the theme's heading partial, create a file at layouts/partials/heading.html in your root directory. This will take precedence over themes/hugo-theme-relearn/layouts/partials/heading.html.
WARNING Do not edit files directly inside the
themes/hugo-theme-relearndirectory. This makes future theme updates difficult. Always use the root directory to perform overrides.
# To override a theme file:
# Theme path: themes/hugo-theme-relearn/layouts/partials/heading.html
# Your path: layouts/partials/heading.htmlIn version 9.0.0, taxonomy and term pages now internally use the children shortcode. This allows you to control the layout of sub-pages by setting children shortcode parameters directly in the front matter of your taxonomy or term pages.
For example, you can change the layout to a card view by passing the appropriate parameters in the page's front matter.