Introduction

Hugo Book is a documentation theme for Hugo. It provides a clean, readable layout for technical docs with minimal dependencies and no build tooling beyond Hugo itself.

Design Goals

Minimalism over features.
The theme ships only what most documentation sites need: a sidebar menu, search, and a few shortcodes. There is no attempt to cover every use case. CSS is written by hand, not generated by a framework. JavaScript is optional for core navigation.
Theme as an extendable base.
Hugo Book is meant to be extended and adapted. ‘Inject’ partials, custom CSS, and Hugo’s template override system let you change any part of the theme without modifying the source, while keeping the codebase intentionally small.
Long-term maintainability.
Few dependencies means fewer things to break. The theme avoids heavy JavaScript libraries, CSS frameworks, and complex build pipelines.

Get Started

Asciinema

Embed terminal recordings with the Asciinema player.

Syntax

{{< asciinema
  cast="recording.cast"
  loop=true
  autoplay=true
  speed=2 >}}

The cast parameter accepts page resources, site resources, or remote URLs.

Example

Parameters

cast
Path to the .cast file. Can be a local resource or a remote URL.

All other parameters are passed directly to the Asciinema player. See the Asciinema player options for the full list.

Common options: autoplay, loop, speed, theme, cols, rows, idleTimeLimit, preload.

Buttons

Styled links that can point to local pages or external URLs. External links automatically open in a new tab.

Syntax

{{< button relref="/" [class="..."] >}}Get Home{{< /button >}}
{{< button href="https://github.com/alex-shpak/hugo-book" >}}Github{{< /button >}}

Example

Home Github

Parameters

href
URL for external links.
relref
Hugo page reference for internal links.
class
Additional CSS classes.

Details

Collapsible content using the HTML5 <details> element.

Syntax

Positional arguments:

{{% details "Title" [open] %}}
Markdown content
{{% /details %}}

Named parameters:

{{% details title="Title" open=true %}}
Markdown content
{{% /details %}}

Example

What Hugo version is required?

Hugo Book requires Hugo {x} or later.

How do I override the theme?

Create matching files in your project’s layouts/ or assets/ directory. Hugo’s lookup order will use your files over the theme’s.

Parameters

title (or first positional argument)
The summary text shown when collapsed.
open (or second positional argument)
Start expanded. Default: collapsed.

Images

Enhanced image display with click-to-expand behavior.

Syntax

{{< image src="photo.jpg" alt="Description" title="Caption" loading="lazy" >}}

Example

Parameters

src
Path to the image. Supports page resources, site resources, and URLs.
alt
Alternate text for accessibility.
title
Caption displayed below the image.
width
Set image width, height is calculated automatically
loading
Loading strategy: lazy, eager, or auto.
class
Additional CSS classes on the <img> element.

Steps

Render an ordered list as a series of numbered steps with visual connectors.

Syntax

{{% steps %}}
1. ## Step Title
   Step description...

2. ## Step Title
   Step description...
{{% /steps %}}

Example

  1. Create your site

    Run hugo new site my-docs to scaffold a new Hugo project.

  2. Add the theme

    Clone or add hugo-book as a submodule in your themes/ directory.

  3. Write content

    Add markdown files under content/docs/. Each file becomes a page in the sidebar menu.

  4. Deploy

    Run hugo to build the site. The output is in the public/ directory, ready for any static hosting.

Tabs

Organize content by context, for example installation instructions for each supported platform.

Syntax

{{< tabs >}}
{{% tab "First" %}} Markdown content {{% /tab %}}
{{% tab "Second" %}} Markdown content {{% /tab %}}
{{< /tabs >}}

Example

brew install hugo
sudo snap install hugo
choco install hugo