Hugo Book
- Introduction: /docs/getting-started/introduction/
- Asciinema: /docs/content/shortcodes/asciinema/
- Buttons: /docs/content/shortcodes/buttons/
- Details: /docs/content/shortcodes/details/
- Images: /docs/content/shortcodes/experimental/images/
- Steps: /docs/content/shortcodes/steps/
- Tabs: /docs/content/shortcodes/tabs/
# Introduction
Hugo Book is a documentation theme for [Hugo](https://gohugo.io). 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](/docs/getting-started/create-a-site/)
## Links
- [Source code](https://github.com/alex-shpak/hugo-book)
- [Hugo documentation](https://gohugo.io/documentation/)
# Asciinema
Embed terminal recordings with the [Asciinema](https://asciinema.org/) player.
## Syntax
```tpl
{{* asciinema
cast="recording.cast"
loop=true
autoplay=true
speed=2 */>}}
```
The `cast` parameter accepts page resources, site resources, or remote URLs.
## Example
{{< asciinema
cast="asciinema-627097.cast"
loop=true
autoplay=true
speed=2 >}}
## 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](https://docs.asciinema.org/manual/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
```tpl
{{* button relref="/" [class="..."] */>}}Get Home{{* /button */>}}
{{* button href="https://github.com/alex-shpak/hugo-book" */>}}Github{{* /button */>}}
```
## Example
{{}}
{{}}
## Parameters
`href`
: URL for external links.
`relref`
: Hugo page reference for internal links.
`class`
: Additional CSS classes.
# Details
Collapsible content using the HTML5 `` element.
## Syntax
Positional arguments:
```tpl
{{%/* details "Title" [open] */%}}
Markdown content
{{%/* /details */%}}
```
Named parameters:
```tpl
{{%/* details title="Title" open=true */%}}
Markdown content
{{%/* /details */%}}
```
## Example
{{% details "What Hugo version is required?" %}}
Hugo Book requires Hugo {x} or later.
{{% /details %}}
{{% details "How do I override the theme?" open %}}
Create matching files in your project's `layouts/` or `assets/` directory. Hugo's lookup order will use your files over the theme's.
{{% /details %}}
## 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
```tpl
{{* image src="photo.jpg" alt="Description" title="Caption" loading="lazy" */>}}
```
## Example
{{< image src="placeholder.svg" alt="Placeholder image" title="Click to expand" loading="lazy" width="50%" >}}
## 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 `` element.
# Steps
Render an ordered list as a series of numbered steps with visual connectors.
## Syntax
```tpl
{{%/* steps */%}}
1. ## Step Title
Step description...
2. ## Step Title
Step description...
{{%/* /steps */%}}
```
## Example
{{% steps %}}
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.
{{% /steps %}}
# Tabs
Organize content by context, for example installation instructions for each supported platform.
## Syntax
```tpl
{{* tabs */>}}
{{%/* tab "First" */%}} Markdown content {{%/* /tab */%}}
{{%/* tab "Second" */%}} Markdown content {{%/* /tab */%}}
{{* /tabs */>}}
```
## Example
{{< tabs >}}
{{% tab "macOS" %}}
```shell
brew install hugo
```
{{% /tab %}}
{{% tab "Linux" %}}
```shell
sudo snap install hugo
```
{{% /tab %}}
{{% tab "Windows" %}}
```shell
choco install hugo
```
{{% /tab %}}
{{< /tabs >}}