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.
OINK Hands-On
OINK Hands-On
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
Write and structure content, use every kind of component, publish posts and books, shape the home page and the look, help readers find their way in several languages, and deploy and upgrade the site.
3. Pages · 4. Components · 5. Diagrams and media · 6. Blog · 7. Book · 8. Home and appearance · 9. Navigation, search and languages · 10. Ship
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
- Figure 6-1 — vonng.com: an author hero over a landscape, then six columns, each with its own feed.
- Figure 7-1 — ddia.vonng.com: contents, the first chapter and the whole book in print, one click each.
Tables
- Table 1-1 — More production OINK sites to model a new site on, by kind of site.
- Table 2-1 — A first review of an agent-built site, in about twenty minutes.
- Table 4-1 — Choosing a component by what the reader is doing.
- Table 6-1 — The four blog index layouts.
- Table 7-1 — Server sizes by sustained ingest rate.
- Table 8-1 — The six visual presets.
- Table 9-1 — The keyboard shortcuts readers use most.
- Table 10-1 — What the build can publish besides HTML.
- Table 10-2 — Four stages from preview to a live site, and what each one leaves open.
- Table A-1 — The front matter keys used in this book, and where each takes effect.
Equations
Examples
- Example 1-1 — A personal blog modeled on vonng.com.
- Example 1-2 — An open-source project site modeled on silo.pgsty.com.
- Example 1-3 — A command-line tool site modeled on pig.pgsty.com.
- Example 1-4 — A book modeled on ddia.vonng.com.
- Example 1-5 — The shape of a site-building prompt.
- Example 2-1 — Follow-up prompts, each one reviewable change.
- Example 3-1 — A complete documentation page: three front matter keys, a lead, three sections.
- Example 3-2 — Prompt: add a page to your own site.
- Example 4-1 — Prompt: restructure a page with components.
- Example 5-1 — Prompt: illustrate a page from text.
- Example 6-1 — A blog post with authors, a series and tags.
- Example 6-2 — Prompt: set up the blog the way vonng.com does.
- Example 7-1 — acme.toml for a server ingesting up to a million points per second.
- Example 7-2 — Prompt: turn a manuscript folder into a book.
- Example 8-1 — A five-section home page for Acme DB.
- Example 8-2 — Prompt: rebuild the home page and the look.
- Example 9-1 — Prompt: tune navigation, search and languages.
- Example 10-1 — Prompt: prepare a release of the site.
1 Build a site from one prompt
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:
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.
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.
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.
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.
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:
- 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,
--helpoutput, 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 |
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
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:
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 |
The production build is the one your host will run:
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.
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:
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
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
-
Clone the Starter and start the preview:
-
Name the site. The first two settings in
hugo.yamlare markedCHANGE ME; the title is a YAML anchor that every language reuses:hugo.yaml -
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:
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:
titleis the page heading, the browser tab and the search result title. AddlinkTitlewhen the sidebar needs a shorter name.descriptionis 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.weightorders 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:
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
- operations/
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:
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.mdreturning the page as plain Markdown.
Ask your agent
4 Structure a page with Markdown components
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 |
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:
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:
-
Create the data directory.
-
Start the server in the foreground.
-
In a second terminal, check that it answers.
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:
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:
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:
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:
server.listen, ,- Address and port for HTTP writes and queries
server.data_dir, ,- Directory for data files and the write-ahead log
retention.default, ,- 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:
./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
- cpu/one directory per table
- 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:
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:
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
runtimetab set switches every other set on the site. - The configuration reference shows three entries with type and default chips, and searching for
retention.defaultopens that entry. - The page’s Markdown copy contains no HTML from the components.
Ask your agent
5 Draw, chart and show
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:
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 --> partsThere 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:
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:
Keep the existing renderer, parser and highlight keys beside it. Then
write the estimate:
Disk use over a retention period is roughly:
for series written times per second for seconds, with bytes per raw point and a compression ratio , 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
- architecture/
Write the image as ordinary Markdown in a paragraph of its own and add one attribute line under it, touching it, for the caption:
Here is the same pattern with an image from this site:

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:

Light mode

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:
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:
- 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
6 Publish posts and release notes
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
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:
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:
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:
| 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 |
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 article layout is four ordinary keys.
A section’s cascade applies them to one column without touching the rest of
the blog:
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:
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:
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.xmllists the 3.0 release notes.
Ask your agent
7 Write a book with numbers and references
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:
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:
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
| 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 |
An equation
The disk column comes from the formula of Chapter 5, now numbered:
A code example
A fence takes num and caption in its own attributes:
A figure
An image in a paragraph of its own takes the same attribute line:

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:
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:
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
xreflink 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
8 Shape the home page and the look
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:
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:
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:
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 |
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:
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
9 Help readers find their way, in their language
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:
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.
Local search
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:
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”:
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 |
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.
Backlinks
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:
What remains in hugo.yaml is one block per language:
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
10 Publish, deploy and keep up to date
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:
| 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 |
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:
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:
- GitHub Pages. In the repository’s Settings → Pages, set Source
to GitHub Actions. Every push to
mainthen builds the site and publishes it, with GitHub’s Pages address, subpath included, passed in asbaseURL. - Cloudflare Pages. Create a Pages project of the Direct Upload kind,
then add the repository secrets
CLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKEN. The workflow builds in GitHub Actions and uploads the result. - 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:
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 |
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.txtand a page’sindex.md. go.modnames an exact OINK tag, andhugo mod graphshows the same one.
Ask your agent
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
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
A directory with this _index.md becomes a sidebar group whose page lists its
children. See Chapter 3.
Docs page
The Chinese peer, quick-start.zh.md, keeps the same weight and the same
heading IDs. See Chapter 3.
Blog root
See Chapter 6.
Immersive column
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
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
See Chapter 6.
Book root
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
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 |

