Skip to content

OINK Hands-On

Get a working OINK site from one prompt, then learn its features one layer at a time, from a single page to a published bilingual site.

OINK Hands-On

Get a working OINK site from one prompt, then learn its features one layer at a time, from a single page to a published bilingual site.

The fastest way to an OINK site is to describe it. Part I hands a coding agent the OINK skill, a published site to follow and the facts about your project, and gets you a working site in one session. Part II then takes the same kind of site apart one layer at a time, so you know what the agent built and can change any of it yourself.

How to read this book

Part I · Quick startChapters 1–2

Build a blog, a project site, a CLI manual or a book from one prompt, preview it, review it and keep improving it with follow-up prompts.

1. Start from a prompt · 2. Take over the site

If you only want a site, Chapter 1 may be all you need. Part II works on one sample project, the documentation site for Acme DB, an open-source time-series database, built from the OINK Starter. Each chapter adds one layer to it and ends with a prompt that asks your agent to do the same on your own site.

This book is itself an OINK Book. Its chapters are numbered, its figures, tables and examples carry numbers that the indexes below collect, the whole book prints as one document at /_print/book/, and every page has a Markdown copy at its address plus index.md. Chapter 7 shows how each of these is written.

Contents

Figures

  1. Figure 6-1 — vonng.com: an author hero over a landscape, then six columns, each with its own feed.
  2. Figure 7-1 — ddia.vonng.com: contents, the first chapter and the whole book in print, one click each.

Tables

  1. Table 1-1 — More production OINK sites to model a new site on, by kind of site.
  2. Table 2-1 — A first review of an agent-built site, in about twenty minutes.
  3. Table 4-1 — Choosing a component by what the reader is doing.
  4. Table 6-1 — The four blog index layouts.
  5. Table 7-1 — Server sizes by sustained ingest rate.
  6. Table 8-1 — The six visual presets.
  7. Table 9-1 — The keyboard shortcuts readers use most.
  8. Table 10-1 — What the build can publish besides HTML.
  9. Table 10-2 — Four stages from preview to a live site, and what each one leaves open.
  10. Table A-1 — The front matter keys used in this book, and where each takes effect.

Equations

  1. Equation 7-1 — Disk use over a retention period.

Examples

  1. Example 1-1 — A personal blog modeled on vonng.com.
  2. Example 1-2 — An open-source project site modeled on silo.pgsty.com.
  3. Example 1-3 — A command-line tool site modeled on pig.pgsty.com.
  4. Example 1-4 — A book modeled on ddia.vonng.com.
  5. Example 1-5 — The shape of a site-building prompt.
  6. Example 2-1 — Follow-up prompts, each one reviewable change.
  7. Example 3-1 — A complete documentation page: three front matter keys, a lead, three sections.
  8. Example 3-2 — Prompt: add a page to your own site.
  9. Example 4-1 — Prompt: restructure a page with components.
  10. Example 5-1 — Prompt: illustrate a page from text.
  11. Example 6-1 — A blog post with authors, a series and tags.
  12. Example 6-2 — Prompt: set up the blog the way vonng.com does.
  13. Example 7-1 — acme.toml for a server ingesting up to a million points per second.
  14. Example 7-2 — Prompt: turn a manuscript folder into a book.
  15. Example 8-1 — A five-section home page for Acme DB.
  16. Example 8-2 — Prompt: rebuild the home page and the look.
  17. Example 9-1 — Prompt: tune navigation, search and languages.
  18. Example 10-1 — Prompt: prepare a release of the site.

1 Build a site from one prompt

Give a coding agent the OINK skill, a production OINK site to model on and the facts about your project, and review a working site the same session.

You do not have to learn OINK before you have an OINK site. Open a coding agent such as Claude Code or Codex in an empty directory, point it at the OINK skill and at a published site that looks like the one you want, and tell it about your project. The agent starts from the Starter, reshapes it after the model, checks the result in a browser and reports what is left. This chapter gives four such prompts, each modeled on a production site, and the pattern for writing your own.

Before you start

The agent runs Git, Go and Hugo on your machine, so install them first; the supported versions are listed in Get started. Then make an empty directory for the site and start the agent inside it:

mkdir my-site && cd my-site
claude        # or codex, or any agent that can run commands and open a browser

Every prompt below begins by sending the agent to https://oink.pgsty.com/skill.md, the OINK skill: one Markdown file holding the build process, the review standards of OINK’s own sites and the mistakes earlier builds made. Reading it from the URL needs no installation. If you build sites often, install it as a skill and start your prompts with “Use the oink-site skill” instead.

Replace everything in <angle brackets> with your own facts before you send a prompt. Keep the line about not copying the model site: the four sites below are open source, but their articles, images and names belong to their authors.

A personal blog like vonng.com

vonng.com is an engineering blog with more than a thousand essays in two languages. Each column is a top-level section with its own feed, column indexes are card grids, and articles open on a full-width image with the outline running beside the text. Model on it when you write regularly and want the site to read like a publication rather than a manual.

Example 1-1 A personal blog modeled on vonng.com.
Read https://oink.pgsty.com/skill.md and follow it to build my personal blog
with OINK in this empty directory.

Model it on https://vonng.com (source: https://github.com/Vonng/vonng.com):
- Each column is a top-level section with its own RSS feed.
- Column indexes are card grids that readers can switch to a list or a table.
- Articles open with a full-width hero image, keep the outline beside the
  text, and end with share buttons.
- Author pages, series and tags are enabled; the home page introduces me
  with a photo and then lists the columns.
- Paper look by default, with dark mode and all six presets in the
  Appearance menu.

About me: <name>, <one-line bio>, writing about <databases and operations>.
Domain: <blog.example.com>. Languages: <English, with Chinese translations>.
Columns: <Engineering, Notes, Travel>.

Borrow structure, configuration and design only; do not copy vonng.com's
articles, images or branding. Write three placeholder posts in my voice.
When it builds, run hugo server, check it in a browser at desktop and phone
widths, and tell me what is still missing.

Expect one directory per column under content/, an author profile under content/authors/, and hugo.yaml settings such as blog_index: cards, featured_image: hero and toc_style: flow. Chapter 6 explains each of them. Open a column and press L to cycle its index layouts, then open a post and check the hero image, the outline and the author byline.

An open-source project site like silo.pgsty.com

silo.pgsty.com serves SILO, an S3-compatible object store: a bilingual manual of about four hundred pages per language, release notes in a blog, a download page, case studies, and a home page assembled from data files with metrics and project cards. Model on it when your project has users who install it, configure it and upgrade it.

Example 1-2 An open-source project site modeled on silo.pgsty.com.
Read https://oink.pgsty.com/skill.md and follow it to build the website for
my open-source project with OINK in this empty directory.

Model it on https://silo.pgsty.com (source: https://github.com/pgsty/silo.pgsty.com):
- A Docs tree: Get started, Configuration, Operations, Reference.
- A Blog with one release-notes post per version.
- A Download page with assets and checksums, kept in data/download/.
- A data-driven home page: hero, metrics, feature cards, a call to action.
- Local search, plus a Markdown copy of every page and an llms.txt.

My project: <name>, <one-line description>, repository <https://github.com/you/project>.
Use its README, docs/ folder and CHANGELOG.md as the source, and keep every
command and configuration key exactly as written there.
Domain: <project.example.com>. Languages: <English and Simplified Chinese>.

Borrow structure, configuration and design only; do not copy SILO's text,
logo or screenshots. When it builds, run hugo server, check both languages in
a browser at desktop and phone widths, and list the pages that still need
real content.

Expect content/docs/ with an _index.md per section, content/blog/release/, a home page in data/home/en.yaml and its translation, and data/download/ records feeding the download page. Chapter 3 covers how the tree becomes the sidebar, and Chapter 8 the home page. Switch languages from the navbar and press / to try search.

A command-line tool site like pig.pgsty.com

pig.pgsty.com documents PIG, a package manager for PostgreSQL extensions. Its manual is deliberately small, about twenty pages per language with one page per subcommand, while a blog of fifty posts carries release notes and longer explanations. Model on it when the reference is short and stable and the news needs room to grow.

Example 1-3 A command-line tool site modeled on pig.pgsty.com.
Read https://oink.pgsty.com/skill.md and follow it to build the website for my
command-line tool with OINK in this empty directory.

Model it on https://pig.pgsty.com (source: https://github.com/pgsty/pig.pgsty.com):
- A shallow manual: Install, Getting started, and one reference page per
  subcommand. Each reference page documents its flags as a field list.
- Install commands for each platform as tabs.
- A Blog with release notes for every version in CHANGELOG.md.
- A home page with a copyable install command and a few metrics.
- "Open in ChatGPT" and "Open in Claude" in the page actions.

My tool: <name>, repository <https://github.com/you/tool>. It is installed
on this machine: run `<tool> --help` and `<tool> <subcommand> --help` for
every subcommand and draft the reference pages from that output.
Domain: <tool.example.com>. Languages: <English and Simplified Chinese>.

Borrow structure, configuration and design only; do not copy PIG's text or
branding. When it builds, run hugo server, check it in a browser, and tell me
which help texts were too thin to document.

Expect a page per subcommand, a {.fields} table of flags on each, and install tabs built from adjacent code fences; Chapter 4 shows both. The assistant links need one setting, which Chapter 10 explains along with the other outputs written for agents.

A book like ddia.vonng.com

ddia.vonng.com publishes Designing Data-Intensive Applications as a multilingual book: two dozen chapters per edition in Simplified and Traditional Chinese and English, more than 130 numbered figures, tables and examples, cross-references that survive chapters moving, a glossary, and the whole book as one printable document. Model on it for any long work read in order: a handbook, a course, a translated book.

Example 1-4 A book modeled on ddia.vonng.com.
Read https://oink.pgsty.com/skill.md and follow it to publish my book with
OINK in this empty directory.

Model it on https://ddia.vonng.com (source: https://github.com/Vonng/ddia):
- A type: book tree with numbered chapters, a preface and a glossary.
- Numbered figures, tables and code examples, with xref cross-references
  instead of hand-written "see Figure 3" links.
- A contents page with lists of figures, tables and examples.
- Whole-book print, so readers can save the book as a PDF.
- Command palette entries for "Start reading" and "Print the whole book".

My manuscript: <the Markdown files in ./manuscript, or book.pdf>, <title>
by <author>. I hold the rights to publish it. Keep the wording exactly as
written; only convert the structure.
Domain: <book.example.com>. Languages: <Simplified Chinese>.

Borrow structure, configuration and design only; do not copy DDIA's text,
figures or cover. Before converting, list the chapters, figures and tables
you found and wait for my confirmation. When it builds, run hugo server and
check the numbering, the cross-references and the print view.

The confirmation step matters for a book: an inventory before conversion catches missing chapters and two files that turned out to be different editions. Chapter 7 explains numbering, xref and the generated indexes.

Write your own prompt

The four prompts share one shape, and so should yours. Leave a part out and the agent guesses it, usually from a site that is not yours:

Example 1-5 The shape of a site-building prompt.
Read https://oink.pgsty.com/skill.md and follow it to build <kind of site>
with OINK in this directory.

Model it on <URL> (source: <repository URL>):
- <each feature of the model you want>

My material: <repository, folder, PDF or old site>; keep <what must not change>.
Facts: name <…>, domain <…>, languages <…>.

Borrow structure, configuration and design only. When it builds, check it in a
browser at desktop and phone widths and report <what you want to hear back>.
  • The skill sends the agent to these docs for syntax and gives it OINK’s review standards. Without it, agents tend to write Docsy or older OINK syntax from memory.
  • The model is a URL plus its source repository, so the agent can read the real configuration instead of guessing from screenshots. List the features you want, because a production site carries many you do not need.
  • Your material is what the agent writes from. A README, --help output, a changelog or an old site produces far better pages than an empty directory, and naming what is authoritative keeps commands and keys intact.
  • The facts are the things no agent can infer: the name, the domain that becomes baseURL, and the languages.
  • The acceptance says when the work is done. The skill already asks for a browser check; say what you want reported, and add “do not push or deploy” if the directory is a real repository.

More model sites

Any site in the case library can be the model. These cover the other common kinds of site:

You want to publish Model site What to borrow
A company or product landing site pgsty.com A bilingual home page built entirely from landing sections
An app with downloads caps.pgsty.com A centered hero, a download page and a compact manual
A catalogue generated from data ext.pgsty.com Thousands of entries rendered from data files, searchable locally
A course or tutorial book pgexp.pgsql.cc Lessons as Book chapters with runnable examples and downloads
A photo archive or exhibition fzb.vonng.com Expo albums beside long-form Book pages
An existing Docsy site, moved to OINK hugegraph.apache.org A brand hero on the Slate preset over migrated bilingual docs
Table 1-1 More production OINK sites to model a new site on, by kind of site.

To move an existing Hugo or Docsy site instead of starting a new one, run the agent in that site’s repository and replace the first lines of Example 1-5 with “Read https://oink.pgsty.com/skill.md and follow it to move this Hugo site to OINK”; the skill covers the migration path described in Upgrade.

What the agent hands back

A finished run ends with a report: what it built, the address of the running preview, the checks it did, and what is still placeholder text. Open the address it gives, usually http://localhost:1313/, and keep the report. Chapter 2 turns it into your own review, so that the site stays yours after the agent’s session ends.

2 Take over the site

Run the preview yourself, learn which file controls what, review the agent’s work against one checklist, and keep improving the site with small follow-up prompts.

The agent’s session ends; the site should not end with it. Before you ask for more, make sure you can run the site without the agent, know where each kind of change lives, and have checked the result yourself. That takes about twenty minutes and turns a generated site into one you own.

Run it yourself

Start the preview from the site’s directory and open the address Hugo prints:

cd my-site
hugo server

The first start takes longer while Hugo downloads the pinned OINK release into its module cache. Then change one sentence on the home page, in data/home/en.yaml or whichever language file the agent wrote, and save. The browser reloads by itself. When your own edit shows up, you no longer depend on the agent for small changes.

Know the five places

An OINK site is an ordinary Hugo repository. Almost every change you will make lands in one of five places:

An OINK site, by where changes go

  • hugo.yamlsite-wide: title, baseURL, languages, menus, params.ui
  • go.modthe OINK release the site is pinned to
  • content/every page; the path is the URL, *.zh.md is the Chinese peer
    • docs/
    • blog/
  • data/the home page sections, download records, footer links
    • home/
  • assets/logo, images to process, css/project.css
  • static/files served exactly as they are
  • layouts/template overrides; ideally empty
  • .github/workflows/the deployment pipeline

content/ and data/ change every week, hugo.yaml changes the whole site at once, and go.mod changes only when you upgrade OINK. layouts/ deserves a look on day one: a file there replaces a theme template and stops receiving the theme’s fixes, so every override should exist for a reason you can name. From scratch explains what each file in a minimal OINK site does.

Review what you got

The agent checked its work, but you are the reader the site is for. Go through these with the preview open:

Check How What it catches
Every language Switch languages from the navbar on three different pages Pages the agent translated in one language only
Every look Press T to cycle presets and Y to cycle light and dark Custom colors that are unreadable in one mode
A phone Narrow the window to about 390 pixels Wide tables, hero images and long code lines
Search Press / and search for a word from your own pages A missing or stale search index
The Markdown copy Append index.md to a page address Components that read badly as plain text for AI readers
Overrides List the files under layouts/ and assets/css/ Templates copied from the theme without a reason
Placeholders Search the repository for <, TODO and example.com Facts the agent could not know and left for you
The production build Run the command below and read every warning Settings OINK ignored and replaced with a safe default
Table 2-1 A first review of an agent-built site, in about twenty minutes.

The production build is the one your host will run:

hugo --cleanDestinationDir --gc --minify --environment production \
  --printPathWarnings

It ends with a Total in … line. Read the warnings above it: OINK reports a mistyped key or an incomplete integration as a warning and keeps building, so a warning usually means a feature you expect is switched off rather than a broken site.

Improve it with follow-up prompts

Ask for one change per prompt, and say how the agent should check it. A small change comes back as a small diff that you can read in a minute; “make the site better” comes back as forty files you cannot review.

Example 2-1 Follow-up prompts, each one reviewable change.
Change the accent color to #0f766e for the whole site and to #6d28d9 for the
blog only. Check both in light and dark mode.

Translate every page under content/docs/get-started/ into Simplified Chinese.
Keep the front matter weights and every heading ID identical to the English.

The install page is too long. Split it into one page per platform under
content/docs/install/, and keep the old address working with aliases.

Run the production build and fix every warning. Explain each fix in one line.

Edit the files yourself when that is quicker than describing the change: a sentence, a menu label, a date. Ask the agent for changes that touch many files at once, such as a translation pass or a restructure, and for settings you have not learned yet. Part II teaches those settings, so that over time you can tell the agent exactly which key to change, or change it yourself.

Save a baseline

Commit the site as it is now, so every later session shows up as a diff against a version you reviewed:

git init        # skip if the agent already created the repository
git add -A
git commit -m "Initial site from the OINK Starter"

The Starter’s .gitignore already keeps public/, resources/ and Hugo’s caches out of Git. Note the Hugo version (hugo version) and the OINK release in go.mod beside the commit; when something changes later, those three facts tell you whether the content, the theme or the toolchain moved.

Where Part II goes

Part II rebuilds the same kinds of features by hand, on one sample project: the documentation site of Acme DB, an open-source time-series database, started from the OINK Starter. Each chapter adds one layer, shows the source beside its result on this page, and ends with a prompt for doing the same on your own site. Chapter 3 starts with a single page.

3 Write a page and give it a place

Set up the sample site, write a page with three front matter keys and stable headings, and let the content tree place it in the sidebar, the pager and a second language.

Most of an OINK site is pages, and a page is a Markdown file whose path is its address. You write no navigation: the directory tree becomes the sidebar, the order of the files becomes the pager, and a file beside it with a .zh.md suffix becomes the Chinese version. This chapter sets up the sample site and adds one page to it.

Set up the sample site

  1. Clone the Starter and start the preview:

    git clone https://github.com/pgsty/oink-starter.git acme-docs
    cd acme-docs
    hugo server
  2. Name the site. The first two settings in hugo.yaml are marked CHANGE ME; the title is a YAML anchor that every language reuses:

    hugo.yaml
    title: &siteTitle Acme DB
    baseURL: https://docs.acme.example/
  3. Open http://localhost:1313/docs/. The Starter’s Docs section has four groups in the sidebar: Introduction, Get Started, Tutorial and Reference. The navbar now reads Acme DB.

Write the page

Create the Quick start page inside Get Started, with this complete content:

Example 3-1 A complete documentation page: three front matter keys, a lead, three sections.
content/docs/get-started/quick-start.md
---
title: Quick start
description: Start Acme DB on a laptop, write a data point and query it back in five minutes.
weight: 30
---

Start one Acme DB server, write a data point over HTTP and read it back with
SQL. You need only the `acme` binary from
[Installation](/docs/get-started/installation/).

## Start the server {#start}

```bash
acme server --data ./acme-data
```

The server listens on port 8086 and keeps its files in `./acme-data`.

## Write a data point {#write}

```bash
curl -X POST http://localhost:8086/write -d 'cpu,host=web1 usage=0.64'
```

## Query it {#query}

```bash
acme sql "SELECT host, usage FROM cpu ORDER BY time DESC LIMIT 1"
```

Save it and look at the preview. Quick start appears in the sidebar under Installation, the pager at the bottom of Installation now leads to it, and the outline on the right lists its three sections.

Each front matter key has one job:

  • title is the page heading, the browser tab and the search result title. Add linkTitle when the sidebar needs a shorter name.
  • description is one sentence about what the reader can do with the page. It appears on section cards, in search results and on social cards, so it decides whether someone opens the page.
  • weight orders the page among its siblings. The Starter’s Requirements and Installation use 10 and 20, so 30 places Quick start after them, and steps of ten leave room for a page in between later.

Start the body with a sentence that says what the page achieves, not with a heading. The theme renders title as the page’s only # heading, so body sections start at ##.

Headings that last

Every heading in Example 3-1 carries an explicit ID, such as {#start}. Without one, Hugo derives the ID from the heading text, so rewording “Start the server” breaks every link to it, and the Chinese heading would get a different ID from the English one. With the ID written out, /docs/get-started/quick-start/#start keeps working through rewrites and in both languages.

Link to other pages with their absolute site path, as the lead paragraph does with /docs/get-started/installation/. The path names the published address, survives moving the source file and is easy to find with a site-wide search. Hugo does not check plain Markdown links, so when you move a page, add its old path to aliases in its front matter and the old address keeps working:

front matter of a moved page
aliases:
  - /docs/tutorial/first-query/

Let the tree be the navigation

A directory with an _index.md becomes a group in the sidebar, and its _index.md is the group’s own page. Add an Operations group with one page in it:

Files added in this step

  • content/docs/
    • operations/
      • _index.mdthe group: title, description, weight 35, an icon
      • backup.mdits first page
content/docs/operations/_index.md
---
title: Operations
description: Back up, upgrade and monitor a running Acme DB server.
weight: 35
icon: fa-solid fa-screwdriver-wrench
---

Keep a production server healthy after the first install.
content/docs/operations/backup.md
---
title: Back up a server
description: Take a consistent snapshot of a running server and restore it on another host.
weight: 10
---

Take snapshots while the server keeps accepting writes.

## Take a snapshot {#snapshot}

```bash
acme backup create --to /backups/acme-$(date +%F)
```

Weight 35 places the group after the Tutorial group (30) and before Reference (40). Its icon shows because the Starter sets sidebar_icon_policy: groups, which gives icons to groups and keeps leaf pages plain. The group’s page lists its children as cards, because the Starter sets section_index: cards; the cards take their text from each child’s description, which is one more reason to write it well.

Two front matter keys move a page out of the way without deleting it. toc_hide: true keeps a published page out of the sidebar and the pager, and draft: true keeps it out of the build until it is ready; preview drafts with hugo server -D.

Add the Chinese peer

The Starter already has Chinese and French, so a translation is one more file beside the English one, with the same name and a language suffix:

content/docs/get-started/quick-start.zh.md
---
title: 快速上手
description: 在笔记本上启动 Acme DB,写入一个数据点并查询出来,五分钟完成。
weight: 30
---

启动一个 Acme DB 服务,通过 HTTP 写入一个数据点,再用 SQL 读出来。你只需要
[安装](/zh/docs/get-started/installation/)一节里的 `acme` 程序。

## 启动服务 {#start}

```bash
acme server --data ./acme-data
```

服务监听 8086 端口,数据文件保存在 `./acme-data`。

## 写入数据点 {#write}

```bash
curl -X POST http://localhost:8086/write -d 'cpu,host=web1 usage=0.64'
```

## 查询数据 {#query}

```bash
acme sql "SELECT host, usage FROM cpu ORDER BY time DESC LIMIT 1"
```

The two files share the weight and every heading ID, and only the prose changes; commands and code stay byte for byte the same. Open the English page and switch to 简体中文 from the navbar: you land on /zh/docs/get-started/quick-start/, and a link to #write lands on the same section in either language. Chapter 9 covers adding and removing languages.

Check your work

With the preview open, you should see:

  • Quick start in the sidebar after Installation, with the pager leading from one to the other;
  • an Operations group with an icon between Tutorial and Reference, and a card for Back up a server on its page;
  • the language switch on Quick start opening the Chinese page at the same section;
  • http://localhost:1313/docs/get-started/quick-start/index.md returning the page as plain Markdown.

Ask your agent

Example 3-2 Prompt: add a page to your own site.
Add a "Quick start" page to the Get started section of the docs, placed after
Installation by its weight. Front matter: title, a one-sentence description of
what the reader achieves, weight. Give every heading an explicit English ID.
Add the Chinese peer as quick-start.zh.md with the same weight and the same
heading IDs. Then open both in the browser and check the sidebar order, the
pager and the language switch.

4 Structure a page with Markdown components

Turn the Quick start into a page readers can follow with callouts, steps, tabs, titled code, field lists, file trees and cards, all written as Markdown that still reads well on GitHub.

A reader scanning a technical page looks for a few shapes: the warning they must not miss, the steps in order, the command for their platform, the setting they came to look up. OINK draws each shape from plain Markdown plus at most one attribute line, so the same source still reads as a quote, a list or a table on GitHub, in print and to an AI assistant. This chapter adds those shapes to the Acme DB pages one at a time; each source below is followed by what it renders.

The pattern

Pick the component by what the reader is doing, not by how it looks:

The reader needs Component You write
A condition they must not miss Callout A blockquote starting with [!IMPORTANT] or another type
A procedure in order Steps An ordered list with {.steps} under it
One choice among equivalents Tabs Adjacent code fences, each with {tab="…"}
A file or command to copy Titled code A fence with {title="…"}
Settings to look up Field list A table with {.fields} under it
A directory layout File tree A filetree fence
Where to go next Cards A link list with {.cards} under it
A key to press, a status Keys, badges The kbd and badge shortcodes
Table 4-1 Choosing a component by what the reader is doing.

Leave everything else as prose. A page where every paragraph sits in a box reads as noise, and readers stop seeing the boxes.

A condition readers cannot miss

Acme DB refuses to start on a 32-bit host, and a reader who skips that line loses ten minutes. Put it at the top of Quick start, under the lead paragraph:

Source
> [!IMPORTANT]
> Acme DB needs a 64-bit Linux or macOS host with at least 2 GB of free memory.
Important

Acme DB needs a 64-bit Linux or macOS host with at least 2 GB of free memory.

Choose the type by what happens when the reader skips the box: NOTE and TIP are safe to skip, IMPORTANT means the task fails without it, WARNING and CAUTION mean something breaks or slows down, and DANGER marks what cannot be undone. Callouts lists all ten types and the collapsible [!DETAILS] form.

A procedure in steps

Under “Start the server”, the reader does three things in order. An ordered list with {.steps} on the line right after it draws them as a numbered column, and each step can hold code:

Source
1. Create the data directory.

   ```bash
   mkdir -p ./acme-data
   ```

1. Start the server in the foreground.

   ```bash
   acme server --data ./acme-data
   ```

1. In a second terminal, check that it answers.

   ```bash
   curl http://localhost:8086/health
   ```
{.steps}
  1. Create the data directory.

    mkdir -p ./acme-data
  2. Start the server in the foreground.

    acme server --data ./acme-data
  3. In a second terminal, check that it answers.

    curl http://localhost:8086/health

Number every item 1. and Markdown counts for you, so adding a step never means renumbering. {.steps} must touch the last item: after a blank line it no longer attaches to the list and shows on the page as text in braces.

Choices as tabs

Some readers run the binary, others run a container. Two adjacent fences with a tab attribute become one tab set, and readers see only the one that applies:

Source
```bash {tab="Binary" group="runtime" value="binary"}
acme server --data ./acme-data
```
```bash {tab="Docker" value="docker"}
docker run -d -p 8086:8086 -v acme-data:/var/lib/acme acme/acme-db:3.0
```
Binary
acme server --data ./acme-data
Docker
docker run -d -p 8086:8086 -v acme-data:/var/lib/acme acme/acme-db:3.0

group ties every tab set of that name together: choose Docker here, and every runtime set on the site switches with it, and the choice is remembered. The URL hash #runtime-docker opens this page with Docker selected. On GitHub, in print and without JavaScript, both blocks show one after the other, so nothing is ever hidden.

Code readers copy

Readers copy configuration into a file, so tell them which file and point at the line that matters:

Source
```toml {title="/etc/acme/acme.toml" hl_lines="3"}
[server]
listen = ":8086"
data_dir = "/var/lib/acme"

[retention]
default = "90d"
```
/etc/acme/acme.toml
[server]
listen = ":8086"
data_dir = "/var/lib/acme"

[retention]
default = "90d"

For a terminal session, use a console fence and write the prompt. The copy button then copies only the commands, without the $ and without the output:

Source
```console
$ acme sql "SELECT host, usage FROM cpu LIMIT 1"
 host | usage
------+-------
 web1 |  0.64
$ acme sql "SELECT count(*) FROM cpu"
```
$ acme sql "SELECT host, usage FROM cpu LIMIT 1"
 host | usage
------+-------
 web1 |  0.64
$ acme sql "SELECT count(*) FROM cpu"

Code blocks covers line numbers, folding long files with collapse, and links to single lines.

Settings as a field list

The Starter’s content/docs/reference/configuration.md is where readers look a key up. A table with {.fields} under it gives each key its own entry, with its type and default as chips and the description at full width, which stays readable on a phone where a four-column table would not:

Source
| Key | Type | Default | Description |
| --- | --- | --- | --- |
| `server.listen` | string | `":8086"` | Address and port for HTTP writes and queries |
| `server.data_dir` | string | `"./acme-data"` | Directory for data files and the write-ahead log |
| `retention.default` | duration | `"90d"` | How long points are kept when a table sets no retention of its own |
{.fields meta="type default"}
server.listen , string , default":8086"
Address and port for HTTP writes and queries
server.data_dir , string , default"./acme-data"
Directory for data files and the write-ahead log
retention.default , duration , default"90d"
How long points are kept when a table sets no retention of its own

meta names the role of each middle column, so type and default render as chips. Every entry gets its own anchor, and local search opens a key’s entry directly when a reader searches for its name.

A directory layout

After the first write, readers want to know what the server put on disk and what they may delete. A filetree fence says it one entry at a time:

Source
```filetree {title="./acme-data after the first write"}
- acme-data/
  - wal/          # the write-ahead log, replayed after a crash
  - tables/
    - cpu/        # one directory per table
      - 2026-11/  # one partition per month
  - acme.lock     # held while the server runs
```

./acme-data after the first write

  • acme-data/
    • wal/the write-ahead log, replayed after a crash
    • tables/
      • cpu/one directory per table
        • 2026-11/one partition per month
    • acme.lockheld while the server runs

Indentation sets the depth, a trailing / marks a directory, and text after # becomes an aligned comment. Readers can fold the directories.

Where to go next as cards

End Quick start by sending readers onward. A link list with {.cards} under it becomes a grid, and the text after the dash becomes each card’s description:

Source
- [Back up a server](/docs/operations/backup/) — Snapshot a running server and restore it on another host.
- [Configuration](/docs/reference/configuration/) — Every key in acme.toml, with its type and default.
{.cards}

Here is the same pattern pointing at the next chapters of this book:

  • Diagrams and media — Draw the architecture, chart a benchmark, play a terminal recording.
  • Blog — Publish release notes and articles with authors and series.
  • Book — Number figures and tables, cross-reference them, print the whole book.

When Markdown runs out

A key to press and a status label have no Markdown syntax, so they are shortcodes:

Source
Stop the server with {{< kbd "Ctrl" "C" >}}. Tiered storage is
{{< badge text="Experimental" tone="warning" >}} in Acme DB 3.0.

Stop the server with Ctrl with C. Tiered storage is Experimental in Acme DB 3.0.

OINK has 29 shortcodes, for cards with icons, multi-paragraph tabs, numbered book figures and the like; Components has a page for each. Reach for one only when the Markdown form cannot say it, because shortcodes are Hugo syntax and show up literally on GitHub.

See how it degrades

Open Quick start and press M, or append index.md to its address. The Markdown copy keeps the callout as > [!IMPORTANT], the steps as a numbered list, the tabs as two fences and the field list as a table. The same holds in the print view, where every tab panel is expanded. That is why the components are Markdown first: a reader on GitHub, a printed page and an AI assistant all get the whole content.

Check your work

  • Quick start opens with the IMPORTANT callout and shows its procedure as numbered steps with code inside.
  • Choosing Docker in one runtime tab set switches every other set on the site.
  • The configuration reference shows three entries with type and default chips, and searching for retention.default opens that entry.
  • The page’s Markdown copy contains no HTML from the components.

Ask your agent

Example 4-1 Prompt: restructure a page with components.
Rework content/docs/get-started/quick-start.md with OINK's Markdown components:
an IMPORTANT callout for the hardware requirement, {.steps} for the start-up
procedure, tabs grouped as "runtime" for the binary and Docker commands, and
cards at the end pointing to the backup and configuration pages. Turn the
configuration reference into a {.fields} table with type and default columns.
Use the component pages under https://oink.pgsty.com/docs/components/ for
syntax. Keep all prose and commands unchanged, apply the same changes to the
Chinese peer, and check both pages and their Markdown copies in the browser.

5 Draw, chart and show

Add an architecture diagram, a benchmark chart, a formula, captioned screenshots, a terminal recording and a release timeline to the Acme DB docs, each kept as text or a file beside the page.

Some facts are shapes: how data flows through the server, how throughput grew from one release to the next, what the dashboard looks like. OINK draws them from text you keep in the page, a few lines of Mermaid, an ECharts option block, a TeX formula, so a change shows up in review as a readable diff and search finds the words inside. This chapter illustrates the Starter’s Architecture page, content/docs/introduction/architecture.md, and the Overview beside it.

A diagram from text

Name a fence mermaid and write the diagram. This one shows how a write reaches disk and how a query finds it:

Source
```mermaid
flowchart LR
  client["Clients"] -->|HTTP write| api["Ingest API"]
  api --> wal[("Write-ahead log")]
  api --> mem["Memtable"]
  mem -->|flush| parts[("Monthly partitions")]
  sql["SQL client"] --> engine["Query engine"]
  engine --> mem
  engine --> parts
```
flowchart LR
  client["Clients"] -->|HTTP write| api["Ingest API"]
  api --> wal[("Write-ahead log")]
  api --> mem["Memtable"]
  mem -->|flush| parts[("Monthly partitions")]
  sql["SQL client"] --> engine["Query engine"]
  engine --> mem
  engine --> parts

There is nothing to configure. The Mermaid engine ships with the theme and runs in the reader’s browser, and only pages with a mermaid fence load it. A corner button opens each diagram in a viewer where readers can pan and zoom. Mermaid covers sequence diagrams, Gantt charts and the rest.

A chart from data

A benchmark is a table of numbers that readers understand faster as bars. An echarts fence holds an ECharts option object in YAML, so the numbers stay in your Markdown:

Source
```echarts {height="300px"}
tooltip:
  trigger: axis
xAxis:
  type: category
  data: ['2.0', '2.4', '3.0']
yAxis:
  type: value
  name: million points/s
series:
  - name: ingest rate, 8 cores
    type: bar
    data: [1.2, 1.9, 3.4]
```
tooltip:
  trigger: axis
xAxis:
  type: category
  data: ['2.0', '2.4', '3.0']
yAxis:
  type: value
  name: million points/s
series:
  - name: ingest rate, 8 cores
    type: bar
    data: [1.2, 1.9, 3.4]

Hugo checks the options while it builds and warns with the line number if they do not parse, and the chart follows light and dark mode. ECharts shows line, pie and combined charts.

A formula

Readers sizing a server want the arithmetic. Formulas are TeX, rendered to HTML and MathML by KaTeX while the site builds, but the $$ and \(…\) delimiters need Goldmark’s passthrough extension, which the Starter does not turn on. Add it to the markup block of hugo.yaml; Hugo does not inherit markup settings from a theme, so OINK cannot do this for you:

hugo.yaml
markup:
  goldmark:
    extensions:
      passthrough:
        enable: true
        delimiters:
          block: [['\[', '\]'], ['$$', '$$']]
          inline: [['\(', '\)']]

Keep the existing renderer, parser and highlight keys beside it. Then write the estimate:

Source
Disk use over a retention period is roughly:

$$
S = \frac{N \cdot f \cdot T \cdot b}{c}
$$

for \(N\) series written \(f\) times per second for \(T\) seconds, with \(b\)
bytes per raw point and a compression ratio \(c\), typically about 10.

Disk use over a retention period is roughly:

S=N⋅f⋅T⋅bc S = \frac{N \cdot f \cdot T \cdot b}{c}

for NN series written ff times per second for TT seconds, with bb bytes per raw point and a compression ratio cc, typically about 10.

A single $ is deliberately not a delimiter, so “$5” in prose stays a price. Chapter 7 numbers a formula like this one.

Screenshots with captions

A screenshot that only one page uses belongs beside that page. Turn the page into a page bundle: move architecture.md to architecture/index.md and put the image in the same directory. The address does not change.

A page bundle

  • content/docs/introduction/
    • architecture/
      • index.md
      • index.zh.md
      • dashboard.webpshared by both languages

Write the image as ordinary Markdown in a paragraph of its own and add one attribute line under it, touching it, for the caption:

Source
![The Acme DB dashboard: ingest rate, query latency and disk use](dashboard.webp)
{caption="The built-in dashboard at http://localhost:8086/ui after the first write."}

Here is the same pattern with an image from this site:

The OINK wordmark written with a fountain pen
An image with a caption: the alt text describes the picture, the caption says why it is there.

The theme writes the image’s size into the page so the text does not jump while it loads. Set params.ui.image_zoom: true in hugo.yaml and readers can click an image to open it full size. To compare screens side by side, write one image per line in a gallery fence:

Source
```gallery
![A fountain pen linked to a manual, a book, an article and a framed picture, drawn for light mode](/images/hero-light.webp) # Light mode
![The same illustration drawn for dark mode](/images/hero-dark.webp) # Dark mode
```

A terminal recording

An installation is easier to follow when watched, and an asciinema recording keeps the output as text, so readers can pause it and copy a command. Put the .cast file under static/ and name it in the shortcode:

Source
{{< asciinema file="images/install.cast" title="Single-node install" >}}

Single-node install — /images/install.cast

This recording is a real six-minute installation of Pigsty on Debian, about 196 KB. Record your own with asciinema rec install.cast. The player ships with the theme and follows the site’s light and dark palette.

Milestones on a timeline

The Overview page tells the project’s history. A definition list with {.timeline} under it lays the events along a line, each beside its marker:

Source
2024-03
: **Acme DB 1.0.** A single-node server with SQL queries.

2025-02
: **Acme DB 2.0.** Monthly partitions and retention policies.

2026-10
: **Acme DB 3.0.** Tiered storage and three times the ingest rate.
{.timeline}
2024-03
Acme DB 1.0. A single-node server with SQL queries.
2025-02
Acme DB 2.0. Monthly partitions and retention policies.
2026-10
Acme DB 3.0. Tiered storage and three times the ingest rate.

Keep a blank line between entries and none before {.timeline}; the build warns when the attribute line has come loose.

Video, audio and more

Each of these has its own page with examples, when your content calls for it:

  • Video — A product demo as an MP4 beside the page, or a YouTube card that loads nothing until clicked.
  • Audio — A podcast episode or a pronunciation sample with the browser’s own player.
  • Draw.io — Diagrams you edit in diagrams.net and keep as SVG.
  • PlantUML — UML diagrams rendered in the browser by a bundled engine.
  • Markmap — A Markdown outline drawn as a mind map.
  • Maps — Points on a map, once you name a tile service.

What loads, and from where

Every engine in this chapter, Mermaid, ECharts, KaTeX’s styles, the asciinema player, is part of the theme, and a page loads only what its own content uses: a page with one chart and no diagram downloads ECharts and not Mermaid. Nothing contacts another server unless you configure it to. A map waits for a tile service you name, and a YouTube card connects to YouTube only when the site allows it and the reader clicks.

Check your work

  • The Architecture page shows the data-flow diagram and the benchmark chart, and both switch with light and dark mode.
  • The formula renders after the passthrough block is in hugo.yaml; before it, $$ shows as text.
  • The screenshot sits in the page bundle, shows its caption, and opens full size when zoom is on.
  • The Overview shows three releases on a timeline.

Ask your agent

Example 5-1 Prompt: illustrate a page from text.
Illustrate content/docs/introduction/architecture.md: add a Mermaid flowchart
of the write and query paths described in the text, and an ECharts bar chart
from the benchmark table in the same page. Keep the table too. If any page
uses $$ formulas, add Goldmark passthrough to hugo.yaml as described at
https://oink.pgsty.com/docs/components/math/. Turn the page into a bundle if
it gains images, give every image alt text and a caption, and check the
result in light and dark mode.

6 Publish posts and release notes

Write dated posts with authors, series and featured images, choose how the index looks, open articles on a full-width image the way vonng.com does, and announce each release.

Documentation answers “how”, and it stays current. A blog answers “what changed, and why”, and it is dated. OINK gives the blog its own shell: posts ordered by date, authors with profile pages, series that read in order, a feed per section and share links at the end. The Starter already has a blog under content/blog/; this chapter writes Acme DB’s first real post and its 3.0 release notes.

Write a post

A post with its own image is a page bundle: a directory holding index.md and the image. Put it in the Starter’s post/ subsection:

content/blog/post/

  • why-monthly-partitions/
    • index.md
    • index.zh.md
    • featured.webpthe post's thumbnail and share image, found by its name
Example 6-1 A blog post with authors, a series and tags.
content/blog/post/why-monthly-partitions/index.md
---
title: Why Acme DB partitions by month
date: 2026-11-02
description: Monthly partitions make retention a file deletion and keep most queries inside one directory.
authors: [mei-lin]
series: [storage-internals]
series_weight: 10
tags: [storage, design]
---

Retention used to mean deleting billions of rows. Since 2.0 it means deleting
one directory.

## One directory per month {#layout}

```filetree
- tables/cpu/
  - 2026-10/
  - 2026-11/
```

Three keys matter more on a post than on a documentation page. date decides the post’s place in the index and its feed timestamp, and a post dated in the future stays out of the build until that day (preview it with hugo server -F). description appears above the body as the post’s lead, so write it as a sentence. And the image named featured.webp becomes the thumbnail on the index and the picture on social cards without any front matter; images: [cover.png] names a different file.

Authors and series

authors and series are Hugo taxonomies, so the site declares them. Writing taxonomies replaces Hugo’s defaults, so list tags and categories again:

hugo.yaml
taxonomies:
  tag: tags
  category: categories
  author: authors
  series: series

The post now shows Mei Lin’s byline, linked to a page listing everything she wrote. That page is the taxonomy term page, and you give it a profile by writing its _index.md:

content/authors/mei-lin/_index.md
---
title: Mei Lin
description: Maintains the Acme DB storage engine.
images: [portrait.webp]
---

Mei has worked on time-series storage since 2018 and wrote the partition layer.

Bylines use the profile’s title, or its linkTitle when you want a shorter name. A series works the same way: posts that name storage-internals show a strip above the body with their position and a link to the next part, ordered by series_weight, and content/series/storage-internals/_index.md introduces the series.

Choose the index

The blog’s front page lists every post, newest first. blog_index sets the layout and blog_index_toggle lets readers switch it themselves:

content/blog/_index.md
blog_index: cards
blog_index_toggle: true
Value What readers see
list Rows with a thumbnail, date, tags and summary. The default
cards A grid of cards with a cropped cover above each title
table One compact row per post: an archive of everything on one page
gallery Covers at their own proportions, for blogs that are mostly pictures
Table 6-1 The four blog index layouts.

With the toggle on, a switch appears beside the title, and L cycles the layouts when keyboard navigation is on. Try it on this site’s blog.

An article that opens on an image

vonng.com opens each article on a full-width image, runs the outline through the text column and drops the sidebar, so the page reads like a magazine. Its home page sets the tone with the same kind of image:

The vonng.com home page: an author hero over a lake, then the list of columns
Figure 6-1 vonng.com: an author hero over a landscape, then six columns, each with its own feed.

The article layout is four ordinary keys. A section’s cascade applies them to one column without touching the rest of the blog:

content/blog/post/_index.md
cascade:
  featured_image: hero
  toc_style: flow
  toc_taxonomies: false
  sidebar_enabled: false

featured_image takes none, banner, wash or hero; a post without an image simply shows none. The post is still an ordinary blog post, with the same feed, byline and series strip. This site’s Immersive reading post uses exactly these keys.

Announce a release

A version announcement is an ordinary post in blog/release/, with the version as its short title. One front matter key links the GitHub release, and the release-card shortcode draws a card with the tag, the date and the source archives from it:

content/blog/release/3.0.0.md
---
title: Acme DB 3.0 — tiered storage and a faster ingest path
linkTitle: v3.0.0
date: 2026-10-20
description: Tiered storage moves old partitions to object storage, and the ingest path is three times faster.
release_url: https://github.com/acme/acme-db/releases/tag/v3.0.0
tags: [release]
---

{{< release-card >}}

## Highlights {#highlights}

- Tiered storage moves partitions older than `retention.hot` to S3.
- Ingest throughput is up from 1.2 to 3.4 million points per second.

The release post says when and why something shipped; the docs pages stay the reference for how to use it. Link from one to the other instead of copying. Releases and downloads adds asset tables with checksums and a download page fed from data/download/.

Feeds and sharing

Every section with the RSS output gets a feed, and the Starter already lists it, so /blog/index.xml carries every post and /blog/release/index.xml only the releases; the RSS button sits on the title row. Share links are off until you name the targets:

hugo.yaml
params:
  ui:
    share: [x, linkedin, hackernews, email, copy]

Each is a plain link or a copy button, and none loads a third-party script. Comments use Giscus once fully configured; see Comments.

Check your work

  • The post appears first on /blog/ with its featured image, and the index switches between four layouts with L.
  • Mei Lin’s name on the post opens her profile, and the series strip shows part 1 of Storage internals.
  • With the cascade in place, posts under post/ open on a full-width image with the outline in the text column.
  • /blog/release/index.xml lists the 3.0 release notes.

Ask your agent

Example 6-2 Prompt: set up the blog the way vonng.com does.
Set up the blog following https://oink.pgsty.com/docs/write/blog/. Enable the
authors and series taxonomies (keep tags and categories), create my author
profile from <bio>, and turn each post with an image into a page bundle with
featured.webp. Give the post/ column the immersive cascade: featured_image
hero, toc_style flow, toc_taxonomies false, sidebar_enabled false. Use a card
index with the layout toggle on. Write release notes for <version> from
CHANGELOG.md with release_url and a release-card. Check the index layouts,
an author page and the feed in the browser.

7 Write a book with numbers and references

Turn a directory into a book with numbered chapters, figures, tables, equations and examples, link them with xref, generate the indexes and print the whole book as one document.

Documentation is consulted; a book is read in order. Its readers expect what print taught them: numbered chapters, “Table 3-1” they can cite, references that keep working when chapters move, and the whole text as one document. OINK provides all of that for any tree marked type: book, while every chapter stays an ordinary Markdown page. The Starter’s content/book/ is already one; this chapter turns it into the Acme DB Operations Handbook, and the numbered items below are live examples in this book.

The book root

The root page declares the type, passes it to every page below, and asks for the print output that produces the whole-book document. The Starter’s root already does all three; give it the handbook’s title:

content/book/_index.md
---
title: The Acme DB Operations Handbook
linkTitle: Handbook
type: book
book_kind: book
outputs: [HTML, print, markdown]
cascade:
  type: book
  sidebar_headings: 3
---

Run Acme DB in production, from sizing the first server to recovering from a
lost disk.

{{< book-toc depth=2 >}}

Front matter outputs replaces the site’s list for this page, so it names every format the root keeps. sidebar_headings: 3 lists each chapter’s headings under it in the sidebar, which helps in long chapters.

Chapters

Each chapter is a page with a number and a position. Replace the Starter’s four sample chapters with the handbook’s own:

content/book/03-capacity.md
---
title: Plan capacity
description: Size CPU, memory and disk for a sustained ingest rate and retention period.
book_kind: chapter
book_number: 3
book_status: draft
weight: 30
---

book_number is shown exactly as written, in the sidebar, the contents and the print view. The theme never derives it from directory order, so 3, A and B are all valid, and moving a file never renumbers a chapter that readers have already cited. book_status: draft labels an unfinished chapter without unpublishing it; with params.ui.book_draft_banner: true the chapter also opens with a notice, the way this book’s draft chapters would.

Number what readers cite

A figure, a table, an equation or a code example gets its number from an attribute line directly under it, with no blank line between: num= is the number as you want it printed and caption= a plain-text caption. In the handbook these would be numbered after chapter 3; here they carry this chapter’s number, 7.

A table

Source
| Sustained ingest | CPU cores | Memory | Disk for 90 days |
| --- | ---: | ---: | ---: |
| 100,000 points/s | 4 | 8 GB | 1.2 TB |
| 1,000,000 points/s | 8 | 32 GB | 12 TB |
| 3,000,000 points/s | 16 | 64 GB | 37 TB |
{num="7-1" caption="Server sizes by sustained ingest rate."}
Sustained ingest CPU cores Memory Disk for 90 days
100,000 points/s 4 8 GB 1.2 TB
1,000,000 points/s 8 32 GB 12 TB
3,000,000 points/s 16 64 GB 37 TB
Table 7-1 Server sizes by sustained ingest rate.

An equation

The disk column comes from the formula of Chapter 5, now numbered:

Source
$$
S = \frac{N \cdot f \cdot T \cdot b}{c}
$$
{num="7-1" caption="Disk use over a retention period."}
S=N⋅f⋅T⋅bc S = \frac{N \cdot f \cdot T \cdot b}{c}
Equation 7-1 Disk use over a retention period.

A code example

A fence takes num and caption in its own attributes:

Source
```toml {num="7-1" caption="acme.toml for a server ingesting up to a million points per second."}
[server]
listen = ":8086"
data_dir = "/var/lib/acme"
memtable_size = "4GB"

[retention]
default = "90d"
```
Example 7-1 acme.toml for a server ingesting up to a million points per second.
[server]
listen = ":8086"
data_dir = "/var/lib/acme"
memtable_size = "4GB"

[retention]
default = "90d"

A figure

An image in a paragraph of its own takes the same attribute line:

Source
![The ddia.vonng.com home page with contents, reading and print buttons](/case/ddia/featured.webp)
{num="7-1" caption="ddia.vonng.com: contents, the first chapter and the whole book in print, one click each." width=900 height=506}
The ddia.vonng.com home page with contents, reading and print buttons
Figure 7-1 ddia.vonng.com: contents, the first chapter and the whole book in print, one click each.

Each kind counts separately, so Table 7-1, Equation 7-1, Example 7-1 and Figure 7-1 coexist. Without an #id, the anchor is the kind and the number, such as #tbl-7-1. Add an explicit one, {#tbl-server-sizes num="7-1" …}, when other sites will link to the target, so a renumbering does not break their links. Keep the attribute line touching its block: a formatter that moves it turns a numbered figure back into a plain image without any warning.

Cross-reference with xref

A hand-written “see Table 7-1” goes stale when the table is renumbered. The xref shortcode builds the label, the number and the link from the kind and the number, in the reader’s language:

Source
Size the server from {{< xref tbl="7-1" />}}, which applies
{{< xref eq="7-1" />}} to 16-byte points with a compression ratio of 10.
Chapter 1 opened with {{< xref eg="1-1" page="/book/01-start" anchor="eg-prompt-blog" />}}.

Size the server from Table 7-1, which applies Equation 7-1 to 16-byte points with a compression ratio of 10. Chapter 1 opened with Example 1-1.

page= points at another chapter, looked up in the current language, so the Chinese edition of this sentence links to the Chinese chapter without a /zh/ prefix in the source. anchor= is needed when the target declared its own ID, as Example 1-1 did. A reference may come before its target, in the same chapter or a later one.

Generated indexes

The root page, or a dedicated contents page, collects everything the chapters registered:

content/book/_index.md
{{< book-toc depth=3 >}}

## Figures {#figures}
{{< book-figures >}}

## Tables {#tables}
{{< book-tables >}}

## Equations {#equations}
{{< book-equations >}}

## Examples {#examples}
{{< book-examples >}}

book-toc lists chapters at depth=1, adds nested sections at 2 and each page’s headings at 3. This book’s root page carries all five; the items numbered in this chapter are listed there beside the prompts from Part I.

Print the whole book

Because the root has the print output, /_print/book/ holds the whole book as one HTML document: a cover, the contents, and every chapter in reading order. Every xref becomes a jump within the document, so the references keep working on paper. Open this book’s print view and save it as a PDF from the browser’s print dialog. For EPUB or a paginated PDF, the theme repository ships two scripts that work from the build output; see Books.

Check your work

  • The handbook’s chapters appear in the sidebar with their numbers, and the draft chapter carries its label.
  • Each numbered item shows its label, such as “Table 3-1”, and its caption.
  • Every xref link lands on its target, including one into another chapter.
  • /_print/book/ contains every chapter, with the contents and indexes linking inside the document.

Ask your agent

Example 7-2 Prompt: turn a manuscript folder into a book.
Turn the Markdown chapters in ./manuscript into an OINK book under
content/book/, following https://oink.pgsty.com/docs/write/book/. One file per
chapter with book_number and weight; keep the wording unchanged. Number every
figure, table and code example after its chapter (3-1, 3-2, …) with native
attribute lines, and replace hand-written "see Figure 3" text with xref. Put
book-toc and the four index shortcodes on the root page and enable the print
output. Report any figure without alt text, then check the numbering, the
cross-references and /_print/book/ in the browser.

8 Shape the home page and the look

Compose the home page from data sections, give the site its name, logo and accent color, pick a visual preset, and let readers choose their own look and dark mode.

Readers decide in seconds whether a site is for them, mostly from its first screen and its look. In OINK neither takes a template: the home page is a YAML file listing sections from top to bottom, and the look is a preset plus a few settings. This chapter gives Acme DB a home page that says what it is and how to install it, then gives the site its own identity.

The home page is data

The Starter’s data/home/en.yaml holds three sections. Replace it with five that tell Acme DB’s story: what it is, a few facts, where to start, the install command, and a closing call to action:

Example 8-1 A five-section home page for Acme DB.
data/home/en.yaml
sections: [hero, metrics, cards, command-box, cta]

hero:
  align: center
  eyebrow: Open-source time-series database
  title_lines:
    - words: [{ text: Acme DB. }]
    - words: [{ text: Years of metrics, queried in milliseconds. }]
  lead: One binary. Write over HTTP, query with SQL, keep data as long as you need.
  actions:
    - { label: Quick start, url: docs/get-started/quick-start/, icon: fa-solid fa-rocket, style: primary }
    - { label: GitHub, url: 'https://github.com/acme/acme-db', external: true, style: ghost }

metrics:
  title: Acme DB 3.0 in numbers
  items:
    - { value: 3400000, compact: true, label: points per second on 8 cores }
    - { value: 10, suffix: '×', label: typical compression }
    - { value: 1, label: binary to install }

cards:
  eyebrow: Where to start
  title: Everything has a place
  columns: 3
  items:
    - title: Quick start
      desc: Start a server, write a point and query it in five minutes.
      icon: fa-solid fa-rocket
      url: docs/get-started/quick-start/
    - title: Operations
      desc: Backups, upgrades and capacity planning for production.
      icon: fa-solid fa-screwdriver-wrench
      url: docs/operations/
    - title: Release notes
      desc: What changed in each version, and how to upgrade.
      icon: fa-solid fa-tag
      url: blog/release/

command-box:
  title: Install
  code: curl -fsSL https://get.acme.example/install.sh | sh
  lang: bash

cta:
  title: Run your first query today.
  text: The quick start takes five minutes on a laptop.
  label: Get started
  url: docs/get-started/quick-start/
  style: primary

To reorder the page, reorder sections; to hide one, write it as { type: metrics, enabled: false } and keep its data. Links to your own pages are site paths without a leading slash, such as docs/operations/, because the theme adds the language prefix: the same link reaches /zh/docs/operations/ from data/home/zh.yaml, which carries the same structure with Chinese text. A misspelled section type warns with unknown section type and is skipped, so read the build output when a section does not appear.

There are 22 section types, among them pricing tables, logo walls, FAQs, a Markdown source beside its rendered result, and download cards fed from the release data; Home and landing pages lists them all. Any other page can use the same sections with layout: landing.

Name, logo and favicon

The name comes from hugo.yaml, which you set in Chapter 3. The mark beside it is the Starter’s neutral assets/icons/logo.svg until you name your own:

hugo.yaml
params:
  logo: icons/acme-mark.svg

Crop the SVG tightly and give it a viewBox, or it will not line up with the text beside it, and choose colors that read on both light and dark backgrounds. Favicons need no setting: put favicon.ico, favicon.svg and apple-touch-icon.png in static/ and every page links them.

An accent color, per section

The accent color marks where the reader is: the selected sidebar row, the outline’s current section, focus rings, card borders on hover. Set one for the site, and give a section its own in a cascade so readers can tell the parts apart:

hugo.yaml
params:
  ui:
    theme_color: '#0f766e'
content/blog/_index.md
cascade:
  theme_color: '#6d28d9'
  theme_color_dark: '#a78bfa'

This book does exactly that: its root page sets theme_color: '#9a3412', which is why the selected chapter in the sidebar and the outline marker are orange here and blue in the Docs. Prose links and inline code keep the preset’s colors everywhere, so a reader recognizes a link the same way in every section.

A preset, and the reader’s choice

A preset is a complete look in light and dark: palette, fonts, link and table style. Choose the one closest to your brand before changing colors by hand:

Preset Look
paper Warm paper, ink text, blue links and accent, Plex Sans and framed tables. The default
slate A cool blue-gray technical look
github GitHub README typography, colors, ruled tables and green buttons. Experimental
ink Written page on warm paper, Palatino and Kai with Fangsong or Song text and vermilion marks. Experimental
news Printed page on grey newsprint, heavy serif and Song headlines, spot blue and double rules. Experimental
terminal Monospace throughout, teal links, amber accents, compact navigation; phosphor screen at night. Experimental
Table 8-1 The six visual presets.
hugo.yaml
params:
  ui:
    preset: paper
    preset_menu: [paper, slate, github, ink, news, terminal]
    dark_mode: true

preset is the site’s look; preset_menu lets readers pick another from the Appearance menu, and dark_mode adds Light, Dark and System to it. A reader’s choice is saved in their browser. Try it on this page: press T to cycle the presets and Y to cycle light and dark. The orange accent survives every combination, because theme_color wins in every preset.

Fonts and your own CSS

The Latin typefaces ship with the theme and are served from your own site, so no page calls a font service; Chinese uses fonts already on the reader’s system. params.ui.typography: system switches every role to the platform’s own fonts. For anything the settings cannot reach, write plain CSS in assets/css/project.css, which loads after the theme’s stylesheet. This recolors the warm secondary accent used in the footer and landing sections, in both modes, because each preset sets its own dark value:

assets/css/project.css
:root {
  --td-brand-copper: #a66722;
}

[data-bs-theme='dark'],
[data-td-preset='paper'][data-bs-theme='dark'] {
  --td-brand-copper: #e0a35c;
}

It is plain CSS, not SCSS, because Hugo publishes it without compiling. Prefer a setting over a selector, and a selector over a copied template: an override in layouts/ stops receiving the theme’s fixes. Brand and appearance lists the font roles and palette variables you can rely on across releases.

Check your work

  • The home page shows the hero, three metrics, three cards, the install command with a copy button, and the closing call to action, in both languages.
  • The Quick start button leads to /docs/get-started/quick-start/ in English and /zh/docs/get-started/quick-start/ in Chinese.
  • The blog uses the purple accent and the rest of the site teal.
  • The Appearance menu offers six presets and three modes, and every combination stays readable.

Ask your agent

Example 8-2 Prompt: rebuild the home page and the look.
Rebuild data/home/en.yaml and data/home/zh.yaml as five sections: hero,
metrics, cards, command-box, cta, following
https://oink.pgsty.com/docs/customize/home/. Take every fact from README.md;
do not invent numbers. Link internal pages as site paths without a leading
slash. Set theme_color to <#0f766e> for the site and give the blog its own
color in a cascade. Keep preset paper with preset_menu [paper, slate, github,
ink, news, terminal] and dark mode on. Then check all six presets in light and
dark mode at desktop and phone widths, and report any section that warns.

9 Help readers find their way, in their language

Add menu entries, tune local search, give the command palette your own commands, learn the keyboard, show backlinks, and settle the site’s languages and the duo view.

Readers rarely arrive at the home page and click down. They come from search, jump between sections, look for one setting, or read in a second language. OINK builds most of the way-finding from what you already wrote, the content tree, the titles and the descriptions, and this chapter adjusts the rest for Acme DB.

Menu entries

The navbar’s Docs dropdown lists the Docs groups. The Starter puts each group there from the group’s own front matter, so add the Operations group from Chapter 3 the same way:

content/docs/operations/_index.md (front matter)
menus:
  main:
    identifier: docs-operations
    parent: docs
    weight: 35
    params:
      icon: fa-solid fa-screwdriver-wrench

The entry appears under Docs, between Tutorial and Reference, in every language that has an Operations page; translate only its title in _index.zh.md. Top-level entries that are not pages, such as a link to a forum, go under languages.<lang>.menus.main in hugo.yaml; the GitHub button at the right end of the navbar comes from params.github_repo. Navigation and menus covers dropdowns, icons and the footer.

The Starter turns search on with params.offline_search: true. Hugo writes an index per language while it builds, and a small engine in the browser searches it, so no query leaves the site and the preview searches exactly like production. It matches English with stemming and spelling fallback, code identifiers, and Chinese typed without spaces. Press / on this page and search for xref to see it.

A page can teach search the words readers type but the page never uses:

content/docs/get-started/quick-start.md (front matter)
search_keywords: [getting started, first query, hello world, tutorial]
search_boost: 1.5

search_keywords usually helps more than a boost: a reader who types “hello world” now finds a page titled Quick start. search_boost multiplies the page’s score, and 1.5 lifts it without letting a partial match beat a complete one.

The command palette and the keyboard

Ctrl with K, or ⌘ with K on a Mac, opens one box for pages and actions: search, switch language or theme, copy the page as Markdown, print the section. A query starting with > lists only actions. Add your own under params.ui.command_palette.commands, the way ddia.vonng.com offers “Start reading”:

hugo.yaml
params:
  ui:
    command_palette:
      commands:
        - id: acme_quick_start
          title: Quick start
          description: Start a server and run the first query
          url: /docs/get-started/quick-start/
          icon: fa-solid fa-rocket
          keywords: [install, first steps]

The keyboard reaches everything without the mouse. Twenty-nine single-key shortcuts are on by default and stand aside while you type in a field; these are the ones readers use most:

Key Action
Q E Previous and next page, in sidebar order
K J Previous and next heading on the page
H The pages you read recently
X The next language
Z Zen Mode, the article alone
' All twenty-nine shortcuts
Table 9-1 The keyboard shortcuts readers use most.

Press E now to go to Chapter 10, or ' to see the rest. Keyboard navigation explains how to turn shortcuts off for a site, a section or a page.

With params.ui.backlinks: true, which the Starter sets, each page lists the pages that link to it in the right rail, under “Backlinks”. Hugo works the list out at build time from your ordinary links, so it needs no new syntax and no script. A reader who lands on Back up a server from search sees at once that Quick start and the configuration reference point to it, which tells them where it sits in the rest of the site.

Settle the languages

The Starter ships English, Chinese and French. Acme DB publishes in English and Chinese, so remove French: delete its block under languages in hugo.yaml, then its content and home page data:

find content -name '*.fr.md' -delete
rm data/home/fr.yaml

What remains in hugo.yaml is one block per language:

hugo.yaml
languages:
  en:
    label: English
    locale: en-US
    weight: 1
    title: *siteTitle
    params:
      description: Documentation for the Acme DB time-series database.
  zh:
    label: 简体中文
    locale: zh-CN
    weight: 2
    title: *siteTitle
    hasCJKLanguage: true
    params:
      description: Acme DB 时序数据库文档。
      time_format_blog: 2006年1月2日

label is the language’s own name in the picker, locale goes into <html lang> and the alternate links search engines read, and weight orders the languages. The default language has no path prefix and the others live under their own, /zh/. The theme’s own labels, such as Search, Next and Backlinks, come in 32 language packs, so a new language needs only your content. Languages covers right-to-left scripts and what happens to pages that have no translation yet.

Read two languages side by side

With params.ui.compare: true, also on in the Starter, a page with a translation gets an Open duo view button beside the page actions: the page on one side, its translation on the other, scrolling together section by section. It is the quickest way to review a translation, because a missing paragraph shows up as a gap. This chapter has a Chinese edition, so press B to try it, and B again to close it.

Check your work

  • The Docs dropdown lists Operations with its icon in both languages.
  • Searching for “hello world” finds Quick start first.
  • The palette, opened with \ (or by typing >), lists the Quick start command.
  • Back up a server shows Quick start under Backlinks.
  • The language picker offers English and 简体中文 only, and the duo view pairs every translated page.

Ask your agent

Example 9-1 Prompt: tune navigation, search and languages.
Make navigation and search work for readers, following
https://oink.pgsty.com/docs/customize/navigation/ and .../search/. Add every
Docs group to the Docs dropdown from its own front matter, with an icon. Add
search_keywords to the ten most important pages with the words readers would
type, in both languages. Add two command palette entries for the most common
tasks. Keep only <English and Chinese>: remove the other languages' blocks,
pages and home data. Then search for each keyword in the browser and confirm
the right page comes first.

10 Publish, deploy and keep up to date

Choose what the site publishes for printers, feed readers and AI assistants, run the production build, deploy with the Starter’s workflow, and upgrade OINK without surprises.

A site is finished when readers can reach it and it stays correct as OINK moves on. The Starter already carries the build settings and the deployment workflows, so this chapter is mostly about knowing what each one does: what the build publishes besides HTML, how to deploy Acme DB’s site, and how to take the next OINK release.

Publish more than HTML

Every page can be published in several forms at once. The Starter lists them under outputs in hugo.yaml:

hugo.yaml
outputs:
  home: [HTML, RSS, markdown, LLMS]
  page: [HTML, markdown]
  section: [HTML, RSS, print, markdown]
Output Published at Who it serves
HTML Every page Readers in a browser
markdown The page address plus index.md AI assistants, and the Copy Markdown and View Markdown page actions
LLMS /llms.txt, one per language An agent finding out what the site contains
print /_print/ plus the section path Readers printing or saving a whole section as a PDF
RSS The section path plus index.xml Feed readers
LLMSFULL /docs/llms-full.txt, when the Docs root lists it An agent reading the whole manual in one request
NAVJSON /navigation.json, when the home page lists it An agent planning which pages to read
Table 10-1 What the build can publish besides HTML.

Each key replaces the whole list for that kind of page, so when you add a format, keep the ones already there; a format left out simply stops being published, without a warning. This site publishes all seven, so you can try them here: press M for this page’s Markdown, or open /llms.txt.

Two more page actions hand the page to an assistant: Open in ChatGPT and Open in Claude. They send the page’s address to that service, so they stay off until you turn them on:

hugo.yaml
params:
  ui:
    page_context_menu:
      assistant_links: true

Build for production

Run the production build from Chapter 2 before every deployment that changes configuration. It is the same command the Starter’s workflows run, so a warning you see locally is a warning your host would print. Then commit hugo.yaml, go.mod and go.sum with your content. Never commit a local module replacement: the host would look for a theme path that exists only on your machine.

Deploy

The Starter ships two workflows in .github/workflows/. Pick the host and follow its steps:

  1. GitHub Pages. In the repository’s Settings → Pages, set Source to GitHub Actions. Every push to main then builds the site and publishes it, with GitHub’s Pages address, subpath included, passed in as baseURL.
  2. Cloudflare Pages. Create a Pages project of the Direct Upload kind, then add the repository secrets CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN. The workflow builds in GitHub Actions and uploads the result.
  3. Check the live site. Open the address the workflow prints, switch languages, search, and open one page’s index.md.

On your own domain, set baseURL to it in hugo.yaml first: canonical links, feeds, llms.txt and social cards are all written with it. Deploy covers other hosts, preview deployments that search engines should not index, and rollback.

Comments and analytics

Anything that would contact another service, comments through Giscus, Google Analytics, a hosted search, stays off until it is configured completely. A half-filled block keeps the feature off rather than falling back to a public default, and analytics run only in production builds, so previews are never tracked. Comments and Analytics list the keys.

Upgrade OINK

The site is pinned to one OINK release in go.mod, so it builds the same way until you decide otherwise. To move to a new release, read its notes first, then pin the exact tag:

hugo mod get github.com/pgsty/oink@v1.8.0
hugo mod tidy
hugo mod graph | grep github.com/pgsty/oink

Pin a published tag, never a branch or @latest, so the same commit of your site always builds the same site. Run the production build, read the warnings, which name any setting the release renamed, look at a few pages in both languages, and commit go.mod and go.sum together. Upgrade lists what changed in each release. If you installed the OINK skill, download it again too: it names the release it was written for.

Know which stage you are at

“It works” means different things at different stages. Say which one you mean, in a pull request or to your agent:

Stage What it proves What it does not
Local preview Pages render and edits show up That the production build is clean
Production build Content, configuration and the pinned release build together That the host builds it the same way
Workflow passed The host built and uploaded the site That the live pages look right
Live site checked Readers get the site you reviewed Anything about the next change
Table 10-2 Four stages from preview to a live site, and what each one leaves open.

Check your work

  • The production build ends with Total in …, and you have read every warning above it.
  • The live site serves both languages, search, llms.txt and a page’s index.md.
  • go.mod names an exact OINK tag, and hugo mod graph shows the same one.

Ask your agent

Example 10-1 Prompt: prepare a release of the site.
Prepare this site for deployment. Check that hugo.yaml has the production
baseURL <https://docs.acme.example/>, that outputs keep HTML, markdown, LLMS,
print and RSS, and that go.mod pins an exact published OINK tag. Run the
production build and fix every warning. Do not push, deploy or change the
pinned release; list what you changed and which stage of
https://oink.pgsty.com/book/10-ship/#stages the site has reached.

Where to go next

You have built every layer of an OINK site once. From here, the reference answers the questions this book did not:

  • Components — One page per component, with every option and its output in print and Markdown.
  • Customization — Navigation, search, languages, versions and print, setting by setting.
  • Case library — Forty-odd production sites, each with what it demonstrates and how.
  • Get started — The OINK skill, to install for your agent.

A Front matter patterns

Copy-and-adapt front matter for Docs groups and pages, blog roots, immersive columns, posts, author profiles, book roots and chapters, as used in this book.

Each pattern holds only the keys that establish the page’s role; add presentation keys when a reader-facing need asks for them. The chapter named under each pattern explains its keys.

Docs group

content/docs/operations/_index.md
title: Operations
description: Back up, upgrade and monitor a running server.
weight: 35
icon: fa-solid fa-screwdriver-wrench

A directory with this _index.md becomes a sidebar group whose page lists its children. See Chapter 3.

Docs page

content/docs/get-started/quick-start.md
title: Quick start
description: Start a server, write a data point and query it back in five minutes.
weight: 30
search_keywords: [getting started, first query]

The Chinese peer, quick-start.zh.md, keeps the same weight and the same heading IDs. See Chapter 3.

Blog root

content/blog/_index.md
title: Blog
type: blog
sidebar_root_for: self
blog_index: cards
blog_index_toggle: true
cascade:
  type: blog
  feedback: false

See Chapter 6.

Immersive column

content/blog/post/_index.md
title: Posts
cascade:
  featured_image: hero
  toc_style: flow
  toc_taxonomies: false
  sidebar_enabled: false

Posts under this column open on a full-width image, with the outline in the text column and no sidebar; feeds, bylines and series are unchanged. See Chapter 6.

Blog post

content/blog/post/why-monthly-partitions/index.md
title: Why Acme DB partitions by month
date: 2026-11-02
description: Monthly partitions make retention a file deletion.
authors: [mei-lin]
series: [storage-internals]
series_weight: 10
tags: [storage, design]

A featured.webp beside index.md becomes the thumbnail and share image. authors and series need their taxonomies declared in hugo.yaml. See Chapter 6.

Author profile

content/authors/mei-lin/_index.md
title: Mei Lin
description: Maintains the Acme DB storage engine.
images: [portrait.webp]

See Chapter 6.

Book root

content/book/_index.md
title: The Acme DB Operations Handbook
type: book
book_kind: book
outputs: [HTML, print, markdown]
cascade:
  type: book
  sidebar_headings: 3

The root holds book-toc and the index shortcodes, and its print output is the whole book as one document. See Chapter 7.

Book chapter

content/book/03-capacity.md
title: Plan capacity
book_kind: chapter
book_number: 3
book_status: draft
weight: 30

book_number is printed exactly as written; book_status: draft labels the chapter without unpublishing it. See Chapter 7.

Where each key takes effect

Key Set on Effect
weight Any page Order among siblings in the sidebar, the pager and the book contents
type A section root, passed down by cascade The reading shell: docs, blog or book
cascade A section root Applies its keys to every page below
blog_index A blog root or column list, cards, table or gallery
featured_image A blog column or post none, banner, wash or hero on the article
book_number A book chapter The chapter number, shown as written
outputs A section root Replaces the site’s output list for that page
Table A-1 The front matter keys used in this book, and where each takes effect.