Hugo Relearn Theme

repository·main·Indexed 20 days ago

https://github.com/mcshelby/hugo-theme-relearn

A 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.

Tokens
83.6K
Snippets
371
Records
615
Agent score
69%

What's inside hugo-theme-relearn

  1. Overview of Hugo Relearn Theme

    main
    The Relearn theme is a documentation-focused theme for Hugo. It is an enhanced fork of the Learn theme, designed to incorporate modern Hugo features while maintaining compatibility with its predecessor. It is suitable for various deployment scenarios, including offline usage and local file system access via the file:// protocol.
  2. How `style` and `color` interact in tabs

    main

    The style parameter determines the base theme application, while color provides a specific override.

    • Severity Styles (e.g., 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.
    • Color Styles (e.g., blue): Sets the background to a lighter version of the chosen color.
    • Default Style: When style: "default" is used with a color, the background is set to your theme's --MAIN-BG-color but tinted with the chosen color.
    • Standalone Color: If only 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 %}}
  3. Understand Semver and Release Types

    main

    The project follows Semantic Versioning (Semver). Release types are determined by the entries in the What's new page:

    • Major Release: Triggered by a {{% badge style="breaking" %}}Breaking{{% /badge %}} entry.
    • Minor Release (Main Release): Triggered by any other entry that is not a breaking change.
    • Patch Release: Contains only bugfixes. These do not result in announcements on the What's new page.

    Entries on the What's new page are enforced by the version-release GitHub Action.

  4. Customize the theme using the Hugo union file system

    main

    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-relearn directory. 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.html
  5. Customize taxonomy and term page layouts

    main

    In 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.