Big documentation rewrite, move docs to example site

This commit is contained in:
Alex Shpak
2026-05-16 23:04:27 +02:00
parent bcce6e25c3
commit c59c9192a8
54 changed files with 1219 additions and 3162 deletions
@@ -0,0 +1,177 @@
---
weight: 30
---
# Configuration
All theme parameters are set under `[params]` in your site config. Every parameter is optional.
## Theme Parameters
```toml {filename=hugo.toml}
[params]
# Color theme: 'light', 'dark' or 'auto'
# Auto switches based on OS/browser preference
BookTheme = 'light'
# Show table of contents on right side of pages
# Can also be set per-page via frontmatter
BookToC = true
# Path to favicon file relative to 'static' directory
BookFavicon = 'favicon.png'
# Path to logo image file relative to 'static' directory
BookLogo = 'logo.png'
# Root section to render as sidebar menu
# Default: 'docs'
BookSection = 'docs'
# Repository URL, used for edit and commit links
BookRepo = 'https://github.com/user/repo'
# Template for "Last Modified" commit link in page footer
# Requires enableGitInfo = true in site config
# Available context: .Site, .Page, .GitInfo
BookLastChangeLink = '{{ .Site.Params.BookRepo }}/commit/{{ .GitInfo.Hash }}'
# Template for "Edit this page" link in page footer
# Available context: .Site, .Page, .Path
BookEditLink = '{{ .Site.Params.BookRepo }}/edit/main/{{ .Path }}'
# Date format used in git info and blog posts
BookDateFormat = 'January 2, 2006'
# Enable full-text search with fuse.js
BookSearch = true
# Enable comments template on pages
# By default uses Disqus; override partials/docs/comments.html for others
BookComments = true
# Enable portable markdown links (resolve relative .md links)
# Values: false, 'warning', 'error'
BookPortableLinks = false
# Enable service worker for offline caching
# Values: false, true, 'precache'
BookServiceWorker = false
# Only show languages that have translations for current page
BookTranslatedOnly = false
```
## Search
Full-text search is enabled by default using [Fuse.js](https://www.fusejs.io/). The search index is built at page load from a generated JSON file.
```toml {filename=hugo.toml}
[params]
BookSearch = true
```
To exclude a page from the search index, set `bookSearchExclude: true` in its frontmatter.
If search is not working, verify that `baseURL` in your config matches the URL where the site is hosted. A mismatch prevents the search index from loading.
## Hugo Site Configuration
These Hugo settings are relevant for the theme
```toml {filename=hugo.toml}
# Preserve URL casing (recommended)
disablePathToLower = true
# Enable git metadata for "Last Modified" footer
enableGitInfo = true
```
## Markup
### Goldmark Renderer
The `unsafe` option is **required** for Mermaid and KaTeX shortcodes to render correctly
```toml {filename=hugo.toml}
[markup.goldmark.renderer]
unsafe = true
```
### Table of Contents
Control the heading levels included in the table of contents
```toml {filename=hugo.toml}
[markup.tableOfContents]
startLevel = 1
endLevel = 4
```
The `startLevel` and `endLevel` values apply globally. Individual pages can toggle the ToC on or off with the `bookToC` frontmatter parameter.
## Output Formats
The theme supports plain text output alongside HTML, useful for accessibility and LLMs
```toml {filename=hugo.toml}
[outputFormats.txt]
mediaType = 'text/plain'
baseName = 'source'
isPlainText = true
[outputs]
home = ['html', 'txt', 'rss']
page = ['html', 'txt']
section = ['html', 'txt']
```
## Portable Links
> [!WARNING]
> Experimental feature. May change or be removed.
Portable links resolve relative markdown links (`[text](./other-page.md)` or `[text](/docs/other-page.md)`) to the correct Hugo URLs. This lets you write standard markdown that works in both text editors and the rendered site.
```toml {filename=hugo.toml}
[params]
BookPortableLinks = 'warning'
```
`false`
: Disabled. Relative `.md` links are not resolved.
`'warning'`
: Enabled. Hugo prints a warning during build if a linked page doesn't exist.
`'error'`
: Enabled. Hugo fails the build if a linked page doesn't exist.
With portable links enabled, you can write
```markdown
See [Configuration](./configuration.md) for details.
```
Instead of Hugo's `relref` shortcode. Both image links and page links are resolved.
## Service Worker
> [!WARNING]
> Experimental feature. May change or be removed.
Hugo Book can register a service worker for offline access to visited pages.
```toml {filename=hugo.toml}
[params]
BookServiceWorker = 'precache'
```
`false`
: Disabled (default).
`true`
: Enables a service worker that caches pages as you visit them for offline reading.
`'precache'`
: Enables a service worker that pre-populates the cache with all site pages on first load. Visited resources are also cached.
@@ -0,0 +1,55 @@
---
weight: 40
title: Content & Structure
bookCollapseSection: true
---
# Content Organization
Hugo Book renders pages from a section as a sidebar menu. By default this is the `docs/` directory.
## Example Directory Structure
```
content/
├── docs/
│ ├── _index.md
│ ├── getting-started.md
│ ├── guide/
│ │ ├── _index.md
│ │ ├── install.md
│ │ └── configure.md
│ └── reference/
│ └── _index.md
├── posts/
│ ├── _index.md
│ └── my-post.md
└── _index.md
```
Pages are ordered by `weight` frontmatter, then alphabetically. Section `_index.md` files define the section entry in the menu.
## Changing the Menu Section
By default, pages under `docs/` are rendered as the sidebar menu. Change this with the `BookSection` parameter in [Configuration](/docs/configuration/). Set to `'/'` to render all top-level sections.
## Page Layouts
The theme provides several layouts:
| Layout | Usage | Description |
| --- | --- | --- |
| (default) | Documentation pages | Sidebar menu + content + optional ToC |
| `landing` | `layout: landing` | Full-width, no sidebar. Used for homepages. |
| `book` | `layout: book` | Single-page view with all subsections listed |
| `posts` | Pages under `posts/` | Blog-style with date, tags, pagination |
Set the layout in frontmatter
```yaml {filename=_index.md}
---
layout: landing
---
```
See [Pages](/docs/content/pages/) for frontmatter reference and [Menus](/docs/content/menus/) for navigation controls.
@@ -0,0 +1,54 @@
---
weight: 3
---
# Blog
Hugo Book includes templates for blog-style posts with dates, tags, and pagination. Blog functionality is very basic.
## Setup
Create a `posts/` section in your content directory
```
content/
└── posts/
├── _index.md
└── my-first-post.md
```
Add the blog section to a menu so readers can find it
```yaml
---
title: Blog
menu:
after:
weight: 5
---
```
## Post Frontmatter
```yaml
---
title: "My First Post"
date: 2025-01-15
tags: ["hugo", "documentation"]
categories: ["Guides"]
---
```
## Thumbnails
Posts can display a thumbnail image. By default the theme looks for a file matching `thumbnail.*` in the post's page bundle. Override the pattern per-post
```yaml
---
bookPostThumbnail: "cover.*"
---
```
## Date Format
The date display format is configured site-wide via `BookDateFormat`. See [Configuration](/docs/configuration/) for details.
@@ -0,0 +1,70 @@
---
weight: 2
---
# Menu System
Hugo Book supports two types of menus: an automatic file-tree menu built from your content structure, and Hugo's standard menu system for additional navigation.
## File-Tree Menu
The sidebar menu is automatically generated from pages in the `BookSection` directory (default: `docs/`). The hierarchy mirrors your directory structure.
Control how sections appear with [page frontmatter](/docs/content/pages/).
## Hugo Menus
The theme renders three Hugo menu locations:
| Menu | Location
| -- | --
| `menu.before` | Rendered **above** the file-tree menu.
| `menu.after` | Rendered **below** the file-tree menu.
| `menu.home` | Rendered on the landing page header (only on pages with `layout: landing`).
### Configuration
Define menus in your site config
```toml {filename=hugo.toml}
[[menu.before]]
name = 'Overview'
url = '/overview/'
weight = 1
[[menu.after]]
name = 'Github'
url = 'https://github.com/user/repo'
weight = 10
[[menu.after]]
name = 'Hugo Themes'
url = 'https://themes.gohugo.io/themes/hugo-book/'
weight = 20
```
Or add pages to menus via frontmatter
```yaml
---
title: Blog
menu:
after:
weight: 5
---
```
### Menu Item Parameters
Menu items support these params under `[params]`:
```toml {filename=hugo.toml}
[[menu.after]]
name = 'Example'
url = '/example/'
weight = 10
[menu.after.params]
bookIcon = 'star' # Icon name to display next to the item
bookNewTab = true # Open the link in a new tab
class = 'custom-class' # CSS class to add to the menu item
```
@@ -0,0 +1,46 @@
---
title: Multi-Language
weight: 4
---
# Multi-Language Support
Hugo Book supports Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/) with content translation by directory.
## Configuration
Define languages in your site config
```toml {filename=hugo.toml}
[languages]
[languages.en]
label = 'English'
contentDir = 'content.en'
weight = 1
[languages.zh]
label = 'Chinese'
contentDir = 'content.zh'
weight = 2
[languages.he]
label = 'Hebrew'
contentDir = 'content.he'
direction = 'rtl'
weight = 3
```
A language selector dropdown appears automatically when multiple languages are configured.
## RTL Support
Set `direction = 'rtl'` on a language to enable right-to-left layout. The entire page layout, including the sidebar menu, mirrors automatically.
## Translation Dropdown
By default, all configured languages appear in the selector. To only show languages that have a translation for the current page
```toml {filename=hugo.toml}
[params]
BookTranslatedOnly = true
```
@@ -0,0 +1,67 @@
---
weight: 1
---
# Page Frontmatter
Every page can use these [frontmatter](https://gohugo.io/content-management/front-matter/) parameters to control its behavior in the theme.
{{< tabs >}}
{{% tab "YAML" %}}
```yaml
---
title: My Page
weight: 10
bookToC: true
bookCollapseSection: true
---
```
{{% /tab %}}
{{% tab "TOML" %}}
```toml
+++
title = 'My Page'
weight = 10
bookToC = true
bookCollapseSection = true
+++
```
{{% /tab %}}
{{% tab "JSON" %}}
```json
{
"title": "My Page",
"weight": 10,
"bookToC": true,
"bookCollapseSection": true
}
```
{{% /tab %}}
{{< /tabs >}}
## Navigation
These parameters control how the page appears in the sidebar menu. Set in page frontmatter.
| Parameter | Default | Description |
| --- | --- | --- |
| `weight` | | Menu ordering. Lower values appear first. Without weight, pages are sorted alphabetically. |
| `bookHidden` | `false` | Hide the page from the sidebar menu. The page is still accessible by URL. |
| `bookCollapseSection` | `false` | Make a section collapsible in the sidebar. Subsections are hidden until clicked. |
| `bookFlatSection` | `false` | Display subsection pages at the same level instead of nesting them. |
| `bookHref` | | Override the menu link with an external URL. |
| `bookIcon` | | Display an icon next to the menu entry. |
## Content Display
These parameters control page content rendering. Set in page frontmatter.
| Parameter | Default | Description |
| --- | --- | --- |
| `bookToC` | | Show or hide the table of contents. Overrides the site-level `BookToC` setting. |
| `bookComments` | | Show or hide comments. Overrides the site-level `BookComments` setting. |
| `bookSearchExclude` | `false` | Exclude this page from the search index. |
See [Blog](/docs/content/blog/) for post-specific frontmatter.
@@ -0,0 +1,139 @@
---
weight: 50
---
# Customization
Hugo Book can be customized through theming, custom SCSS, 'inject' partials, and file overrides.
## Built-in Themes
Set `BookTheme` in your site config
```toml {filename=hugo.toml}
[params]
BookTheme = 'light' # or 'dark', 'auto'
```
| Theme | Description |
| --- | --- |
| `light` | Default. Light background with dark text. |
| `dark` | Dark background (Nord palette) with light text. |
| `auto` | Switches between light and dark based on OS/browser preference (`prefers-color-scheme`). |
## Plugin Themes
Additional themes are available as SCSS plugins. Import in your `assets/_custom.scss`
```scss
@import "plugins/themes";
```
Then set `BookTheme` to one of:
| Theme | Description |
| --- | --- |
| `contrast-light` | High contrast light variant |
| `contrast-dark` | High contrast dark variant |
| `contrast-auto` | High contrast, auto-switching |
| `catppuccin-light` | [Catppuccin](https://catppuccin.com/) Latte palette |
| `catppuccin-dark` | Catppuccin Frappe palette |
| `catppuccin-auto` | Catppuccin, auto-switching |
| `ayu-light` | [Ayu](https://github.com/ayu-theme) light palette |
| `ayu-dark` | Ayu mirage dark palette |
| `ayu-auto` | Ayu, auto-switching |
## Custom Theme
Define a theme mixin in `assets/_custom.scss`
```scss
@mixin theme-mytheme {
--body-background: #fafafa;
--body-font-color: #333;
--color-link: #0066cc;
--color-visited-link: #6633cc;
}
```
Then set `BookTheme = 'mytheme'`. The theme uses `@include theme-{{ .Site.Params.BookTheme }}` to select the mixin at build time.
For auto-switching themes (light/dark based on OS preference), see the `theme-auto` mixin in `assets/_defaults.scss` as a reference.
## CSS Custom Properties
Override CSS custom properties in `_custom.scss` to adjust the current theme. The full set of properties is defined in [`assets/_defaults.scss`](https://github.com/alex-shpak/hugo-book/blob/main/assets/_defaults.scss).
## Custom Styles
The theme includes an empty `assets/_custom.scss` file that is loaded after all theme styles. Create this file in your project's `assets/` directory to add custom CSS without overriding the entire stylesheet.
```scss
// assets/_custom.scss
.book-page {
max-width: 60rem;
}
.book-menu nav {
font-size: 0.9rem;
}
```
## SCSS Plugins
The theme ships with optional SCSS plugins. Import them in your `_custom.scss`:
```scss
@import "plugins/numbered"; /* Automatically number headings in the content area */
@import "plugins/scrollbars"; /* Style scrollbars in the sidebar and content area */
```
## SCSS Variables
Layout variables like sidebar width, breakpoints, and padding are defined in [`assets/_defaults.scss`](https://github.com/alex-shpak/hugo-book/blob/main/assets/_defaults.scss). Override them in your `_custom.scss`.
## 'Inject' Partials
The theme provides empty partial templates at key points in the page layout. Override these to inject custom HTML without modifying the base templates.
Create matching files in your project's `layouts/_partials/docs/inject/` directory.
| Partial | Location |
| --- | --- |
| `inject/head.html` | Inside `<head>`, e.g. meta tags, stylesheets, scripts |
| `inject/body.html` | Before `</body>`, e.g. analytics, chat widgets, scripts |
| `inject/menu-before.html` | Before the sidebar menu |
| `inject/menu-after.html` | After the sidebar menu |
| `inject/content-before.html` | Before the page content |
| `inject/content-after.html` | After the page content |
| `inject/toc-before.html` | Before the table of contents |
| `inject/toc-after.html` | After the table of contents |
| `inject/footer.html` | Inside the page footer |
### Example
To add a Google Analytics script, create `layouts/_partials/docs/inject/head.html`
```html
{{ with .Site.Params.googleAnalytics }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
{{ end }}
```
To add a custom banner above every page, create `layouts/_partials/docs/inject/content-before.html`
```html
<div class="my-banner">
This documentation is for version 2.0. See <a href="/v1/">version 1.0 docs</a>.
</div>
```
## Override Priority
Hugo's [lookup order](https://gohugo.io/templates/lookup-order/) lets you override any theme file by creating the same file in your project:
- `layouts/`: Override templates and partials
- `assets/`: Override SCSS and JavaScript
- `static/`: Override static files (favicon, images)
- `i18n/`: Override or add translations
@@ -1,71 +0,0 @@
---
weight: 1
bookFlatSection: true
title: "Example Site"
---
# Introduction
## Ferre hinnitibus erat accipitrem dixi Troiae tollens
Lorem markdownum, a quoque nutu est *quodcumque mandasset* veluti. Passim
inportuna totidemque nympha fert; repetens pendent, poenarum guttura sed vacet
non, mortali undas. Omnis pharetramque gramen portentificisque membris servatum
novabis fallit de nubibus atque silvas mihi. **Dixit repetitaque Quid**; verrit
longa; sententia [mandat](http://pastor-ad.io/questussilvas) quascumque nescio
solebat [litore](http://lacrimas-ab.net/); noctes. *Hostem haerentem* circuit
[plenaque tamen](http://www.sine.io/in).
- Pedum ne indigenae finire invergens carpebat
- Velit posses summoque
- De fumos illa foret
## Est simul fameque tauri qua ad
Locum nullus nisi vomentes. Ab Persea sermone vela, miratur aratro; eandem
Argolicas gener.
## Me sol
Nec dis certa fuit socer, Nonacria **dies** manet tacitaque sibi? Sucis est
iactata Castrumque iudex, et iactato quoque terraeque es tandem et maternos
vittis. Lumina litus bene poenamque animos callem ne tuas in leones illam dea
cadunt genus, et pleno nunc in quod. Anumque crescentesque sanguinis
[progenies](http://www.late.net/alimentavirides) nuribus rustica tinguet. Pater
omnes liquido creditis noctem.
if (mirrored(icmp_dvd_pim, 3, smbMirroredHard) != lion(clickImportQueue,
viralItunesBalancing, bankruptcy_file_pptp)) {
file += ip_cybercrime_suffix;
}
if (runtimeSmartRom == netMarketingWord) {
virusBalancingWin *= scriptPromptBespoke + raster(post_drive,
windowsSli);
cd = address_hertz_trojan;
soap_ccd.pcbServerGigahertz(asp_hardware_isa, offlinePeopleware, nui);
} else {
megabyte.api = modem_flowchart - web + syntaxHalftoneAddress;
}
if (3 < mebibyteNetworkAnimated) {
pharming_regular_error *= jsp_ribbon + algorithm * recycleMediaKindle(
dvrSyntax, cdma);
adf_sla *= hoverCropDrive;
templateNtfs = -1 - vertical;
} else {
expressionCompressionVariable.bootMulti = white_eup_javascript(
table_suffix);
guidPpiPram.tracerouteLinux += rtfTerabyteQuicktime(1,
managementRosetta(webcamActivex), 740874);
}
var virusTweetSsl = nullGigo;
## Trepident sitimque
Sentiet et ferali errorem fessam, coercet superbus, Ascaniumque in pennis
mediis; dolor? Vidit imi **Aeacon** perfida propositos adde, tua Somni Fluctibus
errante lustrat non.
Tamen inde, vos videt e flammis Scythica parantem rupisque pectora umbras. Haec
ficta canistris repercusso simul ego aris Dixit! Esse Fama trepidare hunc
crescendo vigor ululasse vertice *exspatiantur* celer tepidique petita aversata
oculis iussa est me ferro.
@@ -1,12 +0,0 @@
# 4th Level of Menu
## Caesorum illa tu sentit micat vestes papyriferi
Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non
regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo;
gestanda nitidi, vero? Dum ne pectoraque testantur.
Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut
manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus
pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae
iusto! Sedes ante dum superest **extrema**.
@@ -1,26 +0,0 @@
# 3rd Level of Menu
Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae
miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me
ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta.
Intravit quam erat figentem hunc, motus de fontes parvo tempestate.
iscsi_virus = pitch(json_in_on(eupViral),
northbridge_services_troubleshooting, personal(
firmware_rw.trash_rw_crm.device(interactive_gopher_personal,
software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel,
mips_whitelist_duplex, cpa)));
if (5) {
managementNetwork += dma - boolean;
kilohertz_token = 2;
honeypot_affiliate_ergonomics = fiber;
}
mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet(
analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet),
gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork,
trim_duplex_file), cellTapeDirect, token_tooltip_mashup(
ripcordingMashup)));
module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) +
coreLog.joystick(componentUdpLink), windows_expansion_touchscreen);
bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling(
ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp);
@@ -1,4 +0,0 @@
---
bookCollapseSection: true
weight: 20
---
@@ -1,52 +0,0 @@
---
bookHidden: true
---
# This page is hidden in menu
# Quondam non pater est dignior ille Eurotas
## Latent te facies
Lorem markdownum arma ignoscas vocavit quoque ille texit mandata mentis ultimus,
frementes, qui in vel. Hippotades Peleus [pennas
conscia](http://gratia.net/tot-qua.php) cuiquam Caeneus quas.
- Pater demittere evincitque reddunt
- Maxime adhuc pressit huc Danaas quid freta
- Soror ego
- Luctus linguam saxa ultroque prior Tatiumque inquit
- Saepe liquitur subita superata dederat Anius sudor
## Cum honorum Latona
O fallor [in sustinui
iussorum](http://www.spectataharundine.org/aquas-relinquit.html) equidem.
Nymphae operi oris alii fronde parens dumque, in auro ait mox ingenti proxima
iamdudum maius?
reality(burnDocking(apache_nanometer),
pad.property_data_programming.sectorBrowserPpga(dataMask, 37,
recycleRup));
intellectualVaporwareUser += -5 * 4;
traceroute_key_upnp /= lag_optical(android.smb(thyristorTftp));
surge_host_golden = mca_compact_device(dual_dpi_opengl, 33,
commerce_add_ppc);
if (lun_ipv) {
verticalExtranet(1, thumbnail_ttl, 3);
bar_graphics_jpeg(chipset - sector_xmp_beta);
}
## Fronde cetera dextrae sequens pennis voce muneris
Acta cretus diem restet utque; move integer, oscula non inspirat, noctisque
scelus! Nantemque in suas vobis quamvis, et labori!
var runtimeDiskCompiler = home - array_ad_software;
if (internic > disk) {
emoticonLockCron += 37 + bps - 4;
wan_ansi_honeypot.cardGigaflops = artificialStorageCgi;
simplex -= downloadAccess;
}
var volumeHardeningAndroid = pixel + tftp + onProcessorUnmount;
sector(memory(firewire + interlaced, wired));
@@ -1,85 +0,0 @@
---
weight: 10
---
# Ubi loqui
## Mentem genus facietque salire tempus bracchia
Lorem markdownum partu paterno Achillem. Habent amne generosi aderant ad pellem
nec erat sustinet merces columque haec et, dixit minus nutrit accipiam subibis
subdidit. Temeraria servatum agros qui sed fulva facta. Primum ultima, dedit,
suo quisque linguae medentes fixo: tum petis.
## Rapit vocant si hunc siste adspice
Ora precari Patraeque Neptunia, dixit Danae [Cithaeron
armaque](http://mersis-an.org/litoristum) maxima in **nati Coniugis** templis
fluidove. Effugit usus nec ingreditur agmen *ac manus* conlato. Nullis vagis
nequiquam vultibus aliquos altera *suum venis* teneas fretum. Armos [remotis
hoc](http://tutum.io/me) sine ferrea iuncta quam!
## Locus fuit caecis
Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae
miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me
ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta.
Intravit quam erat figentem hunc, motus de fontes parvo tempestate.
iscsi_virus = pitch(json_in_on(eupViral),
northbridge_services_troubleshooting, personal(
firmware_rw.trash_rw_crm.device(interactive_gopher_personal,
software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel,
mips_whitelist_duplex, cpa)));
if (5) {
managementNetwork += dma - boolean;
kilohertz_token = 2;
honeypot_affiliate_ergonomics = fiber;
}
mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet(
analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet),
gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork,
trim_duplex_file), cellTapeDirect, token_tooltip_mashup(
ripcordingMashup)));
module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) +
coreLog.joystick(componentUdpLink), windows_expansion_touchscreen);
bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling(
ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp);
## Placabilis coactis nega ingemuit ignoscat nimia non
Frontis turba. Oculi gravis est Delphice; *inque praedaque* sanguine manu non.
if (ad_api) {
zif += usb.tiffAvatarRate(subnet, digital_rt) + exploitDrive;
gigaflops(2 - bluetooth, edi_asp_memory.gopher(queryCursor, laptop),
panel_point_firmware);
spyware_bash.statePopApplet = express_netbios_digital(
insertion_troubleshooting.brouter(recordFolderUs), 65);
}
recursionCoreRay = -5;
if (hub == non) {
portBoxVirus = soundWeb(recursive_card(rwTechnologyLeopard),
font_radcab, guidCmsScalable + reciprocalMatrixPim);
left.bug = screenshot;
} else {
tooltipOpacity = raw_process_permalink(webcamFontUser, -1);
executable_router += tape;
}
if (tft) {
bandwidthWeb *= social_page;
} else {
regular += 611883;
thumbnail /= system_lag_keyboard;
}
## Caesorum illa tu sentit micat vestes papyriferi
Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non
regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo;
gestanda nitidi, vero? Dum ne pectoraque testantur.
Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut
manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus
pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae
iusto! Sedes ante dum superest **extrema**.
@@ -1,64 +0,0 @@
---
title: With ToC
weight: 1
---
# Caput vino delphine in tamen vias
## Cognita laeva illo fracta
Lorem markdownum pavent auras, surgit nunc cingentibus libet **Laomedonque que**
est. Pastor [An](http://est.org/ire.aspx) arbor filia foedat, ne [fugit
aliter](http://www.indiciumturbam.org/moramquid.php), per. Helicona illas et
callida neptem est *Oresitrophos* caput, dentibus est venit. Tenet reddite
[famuli](http://www.antro-et.net/) praesentem fortibus, quaeque vis foret si
frondes *gelidos* gravidae circumtulit [inpulit armenta
nativum](http://incurvasustulit.io/illi-virtute.html).
1. Te at cruciabere vides rubentis manebo
2. Maturuit in praetemptat ruborem ignara postquam habitasse
3. Subitarum supplevit quoque fontesque venabula spretis modo
4. Montis tot est mali quasque gravis
5. Quinquennem domus arsit ipse
6. Pellem turis pugnabant locavit
## Natus quaerere
Pectora et sine mulcere, coniuge dum tincta incurvae. Quis iam; est dextra
Peneosque, metuis a verba, primo. Illa sed colloque suis: magno: gramen, aera
excutiunt concipit.
> Phrygiae petendo suisque extimuit, super, pars quod audet! Turba negarem.
> Fuerat attonitus; et dextra retinet sidera ulnas undas instimulat vacuae
> generis? *Agnus* dabat et ignotis dextera, sic tibi pacis **feriente at mora**
> euhoeque *comites hostem* vestras Phineus. Vultuque sanguine dominoque [metuit
> risi](http://iuvat.org/eundem.php) fama vergit summaque meus clarissimus
> artesque tinguebat successor nominis cervice caelicolae.
## Limitibus misere sit
Aurea non fata repertis praerupit feruntur simul, meae hosti lentaque *citius
levibus*, cum sede dixit, Phaethon texta. *Albentibus summos* multifidasque
iungitur loquendi an pectore, mihi ursaque omnia adfata, aeno parvumque in animi
perlucentes. Epytus agis ait vixque clamat ornum adversam spondet, quid sceptra
ipsum **est**. Reseret nec; saeva suo passu debentia linguam terga et aures et
cervix [de](http://www.amnem.io/pervenit.aspx) ubera. Coercet gelidumque manus,
doluit volvitur induta?
## Enim sua
Iuvenilior filia inlustre templa quidem herbis permittat trahens huic. In
cruribus proceres sole crescitque *fata*, quos quos; merui maris se non tamen
in, mea.
## Germana aves pignus tecta
Mortalia rudibusque caelum cognosceret tantum aquis redito felicior texit, nec,
aris parvo acre. Me parum contulerant multi tenentem, gratissime suis; vultum tu
occupat deficeret corpora, sonum. E Actaea inplevit Phinea concepit nomenque
potest sanguine captam nulla et, in duxisses campis non; mercede. Dicere cur
Leucothoen obitum?
Postibus mittam est *nubibus principium pluma*, exsecratur facta et. Iunge
Mnemonidas pallamque pars; vere restitit alis flumina quae **quoque**, est
ignara infestus Pyrrha. Di ducis terris maculatum At sede praemia manes
nullaque!
@@ -1,59 +0,0 @@
---
title: Without ToC
weight: 2
bookToc: false
---
# At me ipso nepotibus nunc celebratior genus
## Tanto oblite
Lorem markdownum pectora novis patenti igne sua opus aurae feras materiaque
illic demersit imago et aristas questaque posset. Vomit quoque suo inhaesuro
clara. Esse cumque, per referri triste. Ut exponit solisque communis in tendens
vincetis agisque iamque huic bene ante vetat omina Thebae rates. Aeacus servat
admonitu concidit, ad resimas vultus et rugas vultu **dignamque** Siphnon.
Quam iugulum regia simulacra, plus meruit humo pecorumque haesit, ab discedunt
dixit: ritu pharetramque. Exul Laurenti orantem modo, per densum missisque labor
manibus non colla unum, obiectat. Tu pervia collo, fessus quae Cretenque Myconon
crate! Tegumenque quae invisi sudore per vocari quaque plus ventis fluidos. Nodo
perque, fugisse pectora sorores.
## Summe promissa supple vadit lenius
Quibus largis latebris aethera versato est, ait sentiat faciemque. Aequata alis
nec Caeneus exululat inclite corpus est, ire **tibi** ostendens et tibi. Rigent
et vires dique possent lumina; **eadem** dixit poma funeribus paret et felix
reddebant ventis utile lignum.
1. Remansit notam Stygia feroxque
2. Et dabit materna
3. Vipereas Phrygiaeque umbram sollicito cruore conlucere suus
4. Quarum Elis corniger
5. Nec ieiunia dixit
Vertitur mos ortu ramosam contudit dumque; placabat ac lumen. Coniunx Amoris
spatium poenamque cavernis Thebae Pleiadasque ponunt, rapiare cum quae parum
nimium rima.
## Quidem resupinus inducto solebat una facinus quae
Credulitas iniqua praepetibus paruit prospexit, voce poena, sub rupit sinuatur,
quin suum ventorumque arcadiae priori. Soporiferam erat formamque, fecit,
invergens, nymphae mutat fessas ait finge.
1. Baculum mandataque ne addere capiti violentior
2. Altera duas quam hoc ille tenues inquit
3. Sicula sidereus latrantis domoque ratae polluit comites
4. Possit oro clausura namque se nunc iuvenisque
5. Faciem posuit
6. Quodque cum ponunt novercae nata vestrae aratra
Ite extrema Phrygiis, patre dentibus, tonso perculit, enim blanda, manibus fide
quos caput armis, posse! Nocendo fas Alcyonae lacertis structa ferarum manus
fulmen dubius, saxa caelum effuge extremis fixum tumor adfecit **bella**,
potentes? Dum nec insidiosa tempora tegit
[spirarunt](http://mihiferre.net/iuvenes-peto.html). Per lupi pars foliis,
porreximus humum negant sunt subposuere Sidone steterant auro. Memoraverit sine:
ferrum idem Orion caelum heres gerebat fixis?
@@ -0,0 +1,101 @@
---
weight: 20
---
# Getting Started
## Prerequisites
- [Hugo](https://gohugo.io/installation/) **extended** edition (required for SCSS processing)
- [Git](https://git-scm.com/downloads) (for theme installation using git submodules)
- [Go](https://go.dev/dl/) (for theme installation using Hugo Modules)
## Quick Start
Use the [starter repository](https://github.com/alex-shpak/hugo-book-starter) to get a working site in seconds. It can also be used as a [GitHub template](https://github.com/alex-shpak/hugo-book-starter/generate) to create a new repository.
```shell
git clone https://github.com/alex-shpak/hugo-book-starter documentation
cd documentation
git submodule update --init --remote
hugo server --minify
```
By default, the theme renders pages under `docs/` section as the sidebar menu. See [Content Organization](/docs/content/) for details.
## Installation Methods
{{< tabs >}}
{{% tab "Git Submodule" %}}
The simplest approach. The theme is vendored directly into your repository.
```shell
git init
git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book
```
Set the theme in your config
```toml {filename=hugo.toml}
theme = 'hugo-book'
```
To update the theme later
```shell
git submodule update --remote --merge
```
{{% /tab %}}
{{% tab "Hugo Module" %}}
Uses [Hugo Modules](https://gohugo.io/hugo-modules/) (requires [Go](https://go.dev/dl/)).
Initialize your site as a module
```shell
hugo mod init github.com/user/my-docs
```
Add the theme import to your config
```toml {filename=hugo.toml}
[module]
[[module.imports]]
path = 'github.com/alex-shpak/hugo-book'
```
To update the theme later
```shell
hugo mod get -u
```
{{% /tab %}}
{{% tab "Manual Download" %}}
Download the theme from [GitHub releases](https://github.com/alex-shpak/hugo-book/releases) and extract it to `themes/hugo-book`.
Set the theme in your config
```toml {filename=hugo.toml}
theme = 'hugo-book'
```
To update, download and extract the new release again.
{{% /tab %}}
{{< /tabs >}}
## Minimal Configuration
```toml {filename=hugo.toml}
baseURL = 'https://example.com/'
title = 'My Documentation'
theme = 'hugo-book'
# Required for mermaid and katex shortcodes
[markup.goldmark.renderer]
unsafe = true
```
See [Configuration](/docs/configuration/) for the full list of parameters.
@@ -0,0 +1,23 @@
---
weight: 10
---
# 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 SCSS, 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/)
## Links
- [Source code](https://github.com/alex-shpak/hugo-book)
- [Hugo documentation](https://gohugo.io/documentation/)
@@ -1,3 +1,20 @@
---
bookFlatSection: true
weight: 60
bookCollapseSection: true
---
# Shortcodes
Hugo Book includes shortcodes for common documentation patterns. All interactive shortcodes work without JavaScript using CSS-only techniques.
Hugo shortcodes use two delimiter styles:
`{{</* shortcode */>}}`
: Renders inner content as plain HTML. Use for shortcodes that don't contain markdown.
`{{%/* shortcode */%}}`
: Processes inner content as markdown. Use when the shortcode body contains markdown formatting.
> [!NOTE]
> Use `{{%/* shortcode */%}}` when the body contains markdown that needs to be rendered. `{{</* shortcode */>}}` passes content as-is without markdown processing.
> When nesting shortcodes (e.g. tabs inside columns), the outer shortcode must use `{{%/* shortcode */%}}` for the inner shortcodes and markdown to be processed.
@@ -1,17 +1,21 @@
# Asciinema
Asciinema shortcode integrates asciinema player into the markdown page.
Embed terminal recordings with the [Asciinema](https://asciinema.org/) player.
## Syntax
```tpl
{{</* asciinema
cast="asciinema-627097.cast"
or
cast="https://asciinema.org/a/vJNKUQFjuh7qKI2j3OoaKs8Jk.cast"
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
@@ -20,6 +24,9 @@ Asciinema shortcode integrates asciinema player into the markdown page.
## Parameters
All parameters added to the shortcode will be transformed to options for Asciinema player, expect `cast` parameter that is used to locate cast file. Cast file follows same rules as portable image, it could be site resource, page resource or remote file URL.
`cast`
: Path to the `.cast` file. Can be a local resource or a remote URL.
[List of Asciinema options](https://docs.asciinema.org/manual/player/options/)
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`.
@@ -1,13 +1,26 @@
# Buttons
Buttons are styled links that can lead to local page or external link.
Styled links that can point to local pages or external URLs. External links automatically open in a new tab.
## Example
## Syntax
```tpl
{{</* button relref="/" [class="..."] */>}}Get Home{{</* /button */>}}
{{</* button href="https://github.com/alex-shpak/hugo-book" */>}}Contribute{{</* /button */>}}
{{</* button href="https://github.com/alex-shpak/hugo-book" */>}}Github{{</* /button */>}}
```
{{<button href="/">}}Get Home{{</button>}}
{{<button href="https://github.com/alex-shpak/hugo-book">}}Contribute{{</button>}}
## Example
{{<button href="/">}}Home{{</button>}}
{{<button href="https://github.com/alex-shpak/hugo-book">}}Github{{</button>}}
## Parameters
`href`
: URL for external links.
`relref`
: Hugo page reference for internal links.
`class`
: Additional CSS classes.
@@ -1,65 +1,47 @@
# Columns
Columns help organize shorter pieces of content horizontally for readability. `columns` shortcode styles markdown list as up to 3 columns.
Organize content horizontally. Renders a markdown list as up to 3 side-by-side columns.
## Example
## Syntax
```tpl
{{%/* columns [ratio="1:1"] [class="..."] */%}}
- ### Left Content
Lorem markdownum insigne...
- ### Left
Content...
- ### Mid Content
Lorem markdownum insigne...
- ### Right Content
Lorem markdownum insigne...
- ### Right
Content...
{{%/* /columns */%}}
```
## Example
{{% columns %}}
- ### Left Content
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
- ### File-Tree Menu
The sidebar menu is automatically generated from your content directory structure. Pages are ordered by `weight` frontmatter.
- ### Mid Content
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter!
- ### Hugo Menus
Additional menu entries can be added above or below the file-tree using Hugo's standard menu system in your site config.
- ### Right Content
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
- ### Landing Menu
Pages with `layout: landing` use a separate menu defined under `menu.home` for header navigation.
{{% /columns %}}
## Settings size ratio for columns
## Custom Ratio
Set relative column widths with the `ratio` parameter
```tpl
{{%/* columns ratio="1:2" */%}}
- ## x1 Column
Lorem markdownum insigne...
- ## x2 Column
Lorem markdownum insigne...
- ### Sidebar
- ### Content Area
{{%/* /columns */%}}
```
{{% columns ratio="1:2" %}}
- ### x1 Column
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
- ### File-Tree Menu
The sidebar menu is automatically generated from your content directory structure. Pages are ordered by `weight` frontmatter.
- ### x2 Column
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter!
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
- ### Hugo Menus
Additional menu entries can be added above or below the file-tree using Hugo's standard menu system in your site config.
{{% /columns %}}
@@ -1,30 +1,37 @@
# Details
Details shortcode is a helper for `details` html5 element. To collapse the details either omit the `open`
keyword when using positional arguments or set `open=false` when using parameters.
Collapsible content using the HTML5 `<details>` element.
## Example with positional arguments
## Syntax
Positional arguments:
```tpl
{{%/* details "Title" [open] */%}}
## Markdown content
Lorem markdownum insigne...
Markdown content
{{%/* /details */%}}
```
{{% details "Title" open %}}
## Markdown content
Lorem markdownum insigne...
{{% /details %}}
## Example with parameters
Named parameters:
```tpl
{{%/* details title="Title" open=true */%}}
## Markdown content
Lorem markdownum insigne...
Markdown content
{{%/* /details */%}}
```
{{% details title="Title" open=true %}}
## Markdown content
Lorem markdownum insigne...
## Example
{{% details "What Hugo version is required?" %}}
Hugo Book requires Hugo {x} or later, extended edition. The extended edition is needed for SCSS processing.
{{% /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.
@@ -1,3 +1,3 @@
---
bookCollapseSection: true
---
---
@@ -1,32 +1,43 @@
# Badges
> [!WARNING]
> Experimental, could change in the future or be removed
Inline labels for annotating content with status, versions, or metadata.
Badges can be used to annotate your pages with additional information or mark specific places in markdown content.
## Syntax
{{< badge title="Title" value="Value" >}}
{{< badge style="info" title="Hugo" value="0.147.6" >}}
{{< badge style="success" title="Build" value="Passing" >}}
{{< badge style="warning" title="Coverage" value="25%" >}}
{{< badge style="danger" title="Issues" value="120" >}}
```tpl
{{</* badge style="info" title="Hugo" value="0.158" */>}}
```
## Examples
## Styles
| Shortcode | Output |
| -- | -- |
| `{{</* badge style="info" title="hugo" value="0.147.6" */>}}` | {{< badge style="info" title="Hugo" value="0.147.6" >}} |
| -- | -- |
| `{{</* badge style="info" title="Hugo" value="0.158" */>}}` | {{< badge style="info" title="Hugo" value="0.158" >}} |
| `{{</* badge style="success" title="Build" value="Passing" */>}}` | {{< badge style="success" title="Build" value="Passing" >}} |
| `{{</* badge style="warning" title="Coverage" value="25%" */>}}` | {{< badge style="warning" title="Coverage" value="25%" >}} |
| `{{</* badge style="danger" title="Issues" value="120" */>}}` | {{< badge style="danger" title="Issues" value="120" >}} |
| `{{</* badge style="warning" title="Coverage" value="25%" */>}}` | {{< badge style="warning" title="Coverage" value="25%" >}} |
| `{{</* badge style="danger" title="Issues" value="120" */>}}` | {{< badge style="danger" title="Issues" value="120" >}} |
| | |
| `{{</* badge style="info" title="Title" */>}}` | {{< badge style="info" title="Title" >}} |
| `{{</* badge style="info" value="Value" */>}}` | {{< badge style="info" value="Value" >}} |
| `{{</* badge title="Default" */>}}` | {{< badge value="Default" >}} |
| `{{</* badge style="info" title="Title" */>}}` | {{< badge style="info" title="Title" >}} |
| `{{</* badge style="info" value="Value" */>}}` | {{< badge style="info" value="Value" >}} |
| `{{</* badge value="Default" */>}}` | {{< badge value="Default" >}} |
## Use in links
## Use in Links
Wrap a badge in a markdown link
A badge can be wrapped in markdown link producing following result: [{{< badge title="Hugo" value="0.147.6" >}}](https://github.com/gohugoio/hugo/releases/tag/v0.147.6)
```tpl
[{{</* badge title="Hugo" value="0.147.6" */>}}](https://github.com/gohugoio/hugo/releases/tag/v0.147.6)
[{{</* badge title="Hugo" value="0.158" */>}}](https://github.com/gohugoio/hugo/releases/tag/v0.158.0)
```
[{{< badge title="Hugo" value="0.158" >}}](https://github.com/gohugoio/hugo/releases/tag/v0.158.0)
## Parameters
`style`
: Visual style. One of: `default`, `info`, `success`, `warning`, `danger`, `note`, `tip`, `important`, `caution`.
`title`
: Label text (left side).
`value`
: Value text (right side).
@@ -1,33 +1,47 @@
# Cards
> [!WARNING]
> Experimental, could change in the future or be removed
Content blocks with optional images and links. Often used with [Columns](/docs/shortcodes/columns) for grid layouts.
## Syntax
```tpl
{{</* card [href="..."] [image="..."] [title="..."] */>}}
Markdown content
{{</* /card */>}}
```
## Example
{{% columns %}}
- {{< card image="placeholder.svg" >}}
### Line 1
Line 2
### With Image
Cards can display an image above the content.
{{< /card >}}
- {{< card image="placeholder.svg" >}}
This is tab MacOS content.
{{< /card >}}
{{% /columns %}}
{{% columns %}}
- {{< card href="/docs/shortcodes/experimental/cards" >}}
**Markdown**
Suspendisse sed congue orci, eu congue metus. Nullam feugiat urna massa.
{{< /card >}}
- {{< card >}}
Suspendisse sed congue orci, eu congue metus. Nullam feugiat urna massa, et fringilla metus consectetur molestie.
### With Link {anchor=false}
When `href` is set, the entire card becomes clickable.
{{< /card >}}
- {{< card title="Card" >}}
### Heading
This is tab MacOS content.
### Plain Card
A basic card with no image or link, used for grouping related content.
{{< /card >}}
{{% /columns %}}
## Parameters
`href`
: Makes the card a link. The entire card area becomes clickable.
`image`
: Path to an image displayed above the card content. Supports page resources and URLs.
`title`
: Accessible title for the card.
`alt`
: Alt text for the card image.
`class`
: Additional CSS classes.
@@ -1,33 +1,30 @@
# Images
> [!WARNING]
> Experimental, could change in the future or be removed
Enhanced image display with click-to-expand behavior.
Image shortcode produces an image that can be clicked to expand.
## Syntax
```tpl
{{</* image src="photo.jpg" alt="Description" title="Caption" loading="lazy" */>}}
```
## Example
```go-html-template
{{</* image src="placeholder.svg" alt="A placeholder" title="A placeholder" loading="lazy" */>}}
```
{{< image src="placeholder.svg" alt="A placeholder" title="A placeholder" loading="lazy" >}}
{{< image src="placeholder.svg" alt="Placeholder image" title="Click to expand" loading="lazy" >}}
## Parameters
`src` {{< badge style="warning" title="Required" >}}
: The link to the image
`src`
: Path to the image. Supports page resources, site resources, and URLs.
`class` {{< badge style="info" title="Optional" >}}
: An optional CSS class name that will be applied to the `img` element
`alt` {{< badge style="info" title="Optional" >}}
: An optional alternate text for the image
`title` {{< badge style="info" title="Optional" >}}
: An optional title for the image
`loading` {{< badge style="info" title="Optional" >}}
: Sets `loading` control for the image: `lazy`, `eager` or `auto`
`alt`
: Alternate text for accessibility.
`title`
: Caption displayed below the image.
`loading`
: Loading strategy: `lazy`, `eager`, or `auto`.
`class`
: Additional CSS classes on the `<img>` element.
@@ -0,0 +1,18 @@
---
bookHidden: true
---
# Section
Render child pages of the current section as a definition list with titles and descriptions.
## Syntax
```tpl
{{</* section [summary] */>}}
```
## Parameters
`summary`
: When present, includes the page summary below each title.
+27 -38
View File
@@ -1,75 +1,64 @@
# Hints
Hint shortcode can be used as a hint/alert/notification block.
Callout blocks for notes, warnings, and other contextual messages. Also supports standard GitHub markdown alerts.
## Syntax
```tpl
{{%/* hint [info|success|warning|danger] */%}}
**Markdown content**
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
Markdown content
{{%/* /hint */%}}
```
Or using markdown alerts
```markdown
> [!NOTE|TIP|IMPORTANT|WARNING|CAUTION]
> **Markdown content**
> Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
> stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
> Markdown content
```
## Example
{{% hint %}}
**Markdown content**
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
**Default hint**
Without a specified type.
{{% /hint %}}
{{% hint info %}}
**Markdown content**
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
**Info**
Use for supplementary information that helps the reader.
{{% /hint %}}
{{% hint success %}}
**Markdown content**
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
**Success**
Use to highlight a recommended approach or positive outcome.
{{% /hint %}}
{{% hint warning %}}
**Markdown content**
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
**Warning**
Use for important caveats or potential issues.
{{% /hint %}}
{{% hint danger %}}
**Markdown content**
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
**Danger**
Use for critical warnings about breaking changes or data loss.
{{% /hint %}}
## Support for markdown alerts
## Markdown Alerts
Standard GitHub markdown alert syntax is also supported:
> [!NOTE]
> **Note**
> Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
> stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
> The theme requires Hugo **extended** edition for SCSS processing.
> [!TIP]
> **Tip**
> Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
> stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
> Set `disablePathToLower = true` in your config to preserve URL casing.
> [!IMPORTANT]
> **Important**
> Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
> stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
> The `unsafe = true` goldmark setting is required for Mermaid and KaTeX shortcodes.
> [!WARNING]
> **Warning**
> Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
> stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
> Service worker support is experimental and may change in future releases.
> [!CAUTION]
> **Caution**
> Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
> stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
> Enabling `BookPortableLinks = 'error'` will fail the build if any markdown link targets are missing.
+39 -49
View File
@@ -4,73 +4,62 @@ title: KaTeX
# KaTeX
KaTeX shortcode let you render math typesetting in markdown document. See [KaTeX](https://katex.org/)
Render math typesetting with [KaTeX](https://katex.org/). The library is loaded automatically on first use.
{{% hint info %}}
**Override KaTeX initialization config**
To override the [initialization config](https://katex.org/docs/options.html) for KaTeX,
create a `katex.json` file in your `assets` folder!
{{% /hint %}}
# Example
{{< katex />}}
## Activation
KaTeX is activated on the page by first use of the shortcode or render block. you can force activation with empty `{{</* katex /*/>}}` and use delimiters defined in configuration in `assets/katex.json`.
## Rendering as block
KaTeX is activated on the page by the first use of the shortcode or a `katex` code block. You can force activation with `{{</* katex /*/>}}`, then use delimiters anywhere on the page.
## Block Rendering
Three equivalent ways to render display math:
{{% columns %}}
```latex
{{</* katex display=true >}}
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{< /katex */>}}
```
- **Shortcode**
```tpl
{{</* katex display=true >}}
f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{< /katex */>}}
```
````latex
```katex
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
```
````
- **Code block**
````
```katex
f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
```
````
````latex
$$
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$
````
<--->
{{< katex display=true >}}
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{< /katex >}}
---
```katex
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
```
---
$$
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$
- **Dollar delimiters**
```
$$
f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$
```
{{% /columns %}}
## Rendering inline
When KaTeX is active on the page it is possible to write inline expressions.
Result:
| Code | Output |
| -- | -- |
$$
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$
## Inline Rendering
| Syntax | Output |
| -- | -- |
| `{{</* katex >}}\pi(x){{< /katex */>}}` | {{< katex >}}\pi(x){{< /katex >}} |
| `\\( \pi(x) \\)` | \\( \pi(x) \\) |
## Configuration
KaTeX configuration could be adjusted by editing `assets/katex.json` file. For example to enabled inline delimiters `$..$` put content below into the file.
Override KaTeX options by creating `assets/katex.json`. For example, to enable `$...$` inline delimiters
```json
{
@@ -83,3 +72,4 @@ KaTeX configuration could be adjusted by editing `assets/katex.json` file. For e
}
```
See [KaTeX options](https://katex.org/docs/options.html) for all available settings.
+58 -175
View File
@@ -1,186 +1,69 @@
# Mermaid Chart
# Mermaid
[MermaidJS](https://mermaid-js.github.io/) is library for generating svg charts and diagrams from text.
Render diagrams and charts with [Mermaid](https://mermaid.js.org/). The library is loaded automatically on first use.
{{% hint info %}}
**Override Mermaid initialization config**
To override the [initialization config](https://mermaid-js.github.io/mermaid/#/Setup) for Mermaid,
create a `mermaid.json` file in your `assets` folder!
{{% /hint %}}
> [!TIP]
> Override Mermaid initialization by creating `assets/mermaid.json` in your project.
## Example
## Syntax
Use fenced code blocks (recommended) or the shortcode
````tpl
```mermaid
graph LR
A --> B
```
````
```tpl
{{</* mermaid [class="..."] */>}}
graph LR
A --> B
{{</* /mermaid */>}}
```
## Examples
{{% columns %}}
- ````tpl
```mermaid
stateDiagram-v2
State1: The state with a note
note right of State1
Important information! You can write
notes.
end note
State1 --> State2
note left of State2 : This is the note to the left.
```
````
- ```mermaid
stateDiagram-v2
State1: The state with a note
note right of State1
Important information! You can write
notes.
end note
State1 --> State2
note left of State2 : This is the note to the left.
```
{{% /columns %}}
{{% columns %}}
- ```tpl
{{</* mermaid [class="..."] >}}
stateDiagram-v2
State1: The state with a note
note right of State1
Important information! You can write
notes.
end note
State1 --> State2
note left of State2 : This is the note to the left.
{{< /mermaid */>}}
flowchart TD
A[Content Files] --> B[Hugo Build]
B --> C[HTML Output]
B --> D[Search Index]
B --> E[RSS Feed]
```
```mermaid
sequenceDiagram
Browser->>Hugo: Request page
Hugo->>Theme: Apply template
Theme->>Browser: Rendered HTML
Browser->>Browser: Load shortcodes
```
- ```mermaid
pie title Theme Assets
"SCSS" : 8
"HTML Templates" : 30
"JavaScript" : 3
"i18n Files" : 35
```
```mermaid
gitGraph
commit id: "init"
commit id: "add theme"
branch feature
checkout feature
commit id: "add docs"
commit id: "add config"
checkout main
merge feature
commit id: "deploy"
```
- {{< mermaid >}}
stateDiagram-v2
State1: The state with a note
note right of State1
Important information! You can write
notes.
end note
State1 --> State2
note left of State2 : This is the note to the left.
{{< /mermaid >}}
{{% /columns %}}
## Diagrams
Explore more diagrams and syntax on Mermaid [documentation page](https://mermaid.js.org/syntax/flowchart.html).
{{% columns %}}
```mermaid
stateDiagram-v2
State1: The state with a note
note right of State1
Important information! You can write
notes.
end note
State1 --> State2
note left of State2 : This is the note to the left.
```
```mermaid
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
```
```mermaid
---
title: Animal example
---
classDiagram
note "From Duck till Zebra"
Animal <|-- Duck
note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
```
```mermaid
---
title: Simple sample
---
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
```
<--->
```mermaid
---
title: Example Git diagram
---
gitGraph
commit
commit
branch develop
checkout develop
commit
commit
checkout main
merge develop
commit
commit
```
```mermaid
gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
A task :a1, 2014-01-01, 30d
Another task :after a1, 20d
section Another
Task in Another :2014-01-12, 12d
another task :24d
```
```mermaid
pie title Pets adopted by volunteers
"Dogs" : 386
"Cats" : 85
"Rats" : 15
```
```mermaid
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
```
{{% /columns %}}
Explore more diagram types on the [Mermaid documentation](https://mermaid.js.org/syntax/flowchart.html).
@@ -1,16 +0,0 @@
---
bookCollapseSection: true
bookHidden: true
---
# Section
Section renders pages in section as definition list, using title and description. Optional param `summary` can be used to show or hide page summary
## Example
```tpl
{{</* section [summary] */>}}
```
{{<section summary>}}
@@ -1,6 +0,0 @@
# First page
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
<!--more-->
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@@ -1,6 +0,0 @@
# Second Page
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
<!--more-->
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+16 -20
View File
@@ -1,35 +1,31 @@
# Steps
Steps shortcode styles numbered list as series of points for better content organization.
Render an ordered list as a series of numbered steps with visual connectors.
## Syntax
```tpl
{{%/* steps */%}}
1. ## Suspendisse sed congue orci.
...
1. ## Step Title
Step description...
2. ## Maecenas scelerisque sem.
...
3. ## Etiam risus purus.
...
4. ## Curabitur sed lacinia velit.
...
2. ## Step Title
Step description...
{{%/* /steps */%}}
```
## Example
{{% steps %}}
1. ## Suspendisse sed congue orci.
Suspendisse sed congue orci, eu congue metus. Nullam feugiat urna massa, et fringilla metus consectetur molestie. Curabitur pellentesque sodales ipsum, sed efficitur libero euismod ac. Donec sit amet erat nunc. Suspendisse porta nisl velit, quis auctor massa commodo nec. Donec sollicitudin tellus sit amet massa condimentum luctus. Etiam molestie at ante et convallis.
1. ## Create your site
Run `hugo new site my-docs` to scaffold a new Hugo project.
2. ## Maecenas scelerisque sem.
Maecenas scelerisque sem a tellus dignissim, in sodales neque varius. Integer quis ex quis sem posuere consequat. Morbi interdum ex et mollis maximus. Proin sed quam nisl. Donec tempus non risus vel auctor. Ut ultricies vitae urna in laoreet. Phasellus cursus nunc sit amet sodales euismod. Suspendisse potenti.
2. ## Add the theme
Clone or add hugo-book as a submodule in your `themes/` directory.
3. ## Etiam risus purus.
Etiam risus purus, suscipit a orci quis, mollis mollis ante. Vestibulum congue nisl malesuada tortor egestas, a lobortis tellus dictum. Nam nec ultrices justo. Donec malesuada dignissim posuere.
3. ## Write content
Add markdown files under `content/docs/`. Each file becomes a page in the sidebar menu.
4. ## Curabitur sed lacinia velit.
Curabitur sed lacinia velit. Nullam sed ante non quam lobortis hendrerit. Phasellus elementum, erat sit amet imperdiet pulvinar, odio massa lobortis ipsum, in tincidunt metus dolor vel ligula.
{{% /steps %}}
4. ## Deploy
Run `hugo` to build the site. The output is in the `public/` directory, ready for any static hosting.
{{% /steps %}}
+15 -29
View File
@@ -1,12 +1,13 @@
# Tabs
Tabs let you organize content by context, for example installation instructions for each supported platform.
Organize content by context, for example installation instructions for each supported platform.
## Syntax
```tpl
{{</* tabs */>}}
{{%/* tab "MacOS" */%}} # MacOS Content {{%/* /tab */%}}
{{%/* tab "Linux" */%}} # Linux Content {{%/* /tab */%}}
{{%/* tab "Windows" */%}} # Windows Content {{%/* /tab */%}}
{{%/* tab "First" */%}} Markdown content {{%/* /tab */%}}
{{%/* tab "Second" */%}} Markdown content {{%/* /tab */%}}
{{</* /tabs */>}}
```
@@ -14,37 +15,22 @@ Tabs let you organize content by context, for example installation instructions
{{< tabs >}}
{{% tab "MacOS" %}}
# MacOS
This is tab **MacOS** content.
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
{{% tab "macOS" %}}
```shell
brew install hugo
```
{{% /tab %}}
{{% tab "Linux" %}}
# Linux
This is tab **Linux** content.
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
```shell
sudo snap install hugo
```
{{% /tab %}}
{{% tab "Windows" %}}
# Windows
This is tab **Windows** content.
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
```shell
choco install hugo-extended
```
{{% /tab %}}
{{< /tabs >}}
@@ -1,106 +0,0 @@
---
bookHidden: true
---
{{% columns %}}
- ## Asciinema
{{< asciinema
cast="asciinema-627097.cast"
loop=true
autoplay=true
speed=2 >}}
- ## Badge
{{<badge title="Title" value="Value">}}
- ## Button
{{<button href="/">}}A Button{{</button>}}
- ## Card
{{<card href="/docs/shortcodes/experimental/cards">}}
**Markdown**
Suspendisse sed congue orci, eu congue metus. Nullam feugiat urna massa.
{{</card>}}
- ## Details
{{<details "Title" open>}}
## Markdown content
Lorem markdownum insigne...
{{</details>}}
- ## Hint
{{<hint danger>}}
**Markdown content**
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
{{</hint>}}
- ## Image
{{<image src="placeholder.svg" alt="A placeholder" title="A placeholder" loading="lazy">}}
- ## KaTeX
{{<katex display="true">}}
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{</katex>}}
- ## Mermaid
{{<mermaid>}}
stateDiagram-v2
State1: The state with a note
note right of State1
Important information! You can write
notes.
end note
State1 --> State2
note left of State2 : This is the note to the left.
{{</mermaid>}}
- ## Steps
{{<steps>}}
1. ## Suspendisse sed congue orci.
Suspendisse sed congue orci, eu congue metus.
2. ## Maecenas scelerisque sem.
Maecenas scelerisque sem a tellus dignissim.
3. ## Etiam risus purus.
Etiam risus purus, suscipit a orci quis.
4. ## Curabitur sed lacinia velit.
Curabitur sed lacinia velit. Nullam sed ante non quam.
{{</steps>}}
- ## Tabs
{{<tabs>}}
{{<tab "MacOS">}}
# MacOS
This is tab **MacOS** content.
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
{{</tab>}}
{{<tab "Linux">}}
# Linux
This is tab **Linux** content.
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
{{</tab>}}
{{<tab "Windows">}}
# Windows
This is tab **Windows** content.
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
{{</tab>}}
{{</tabs>}}
{{% /columns %}}