Skip to content

This is the multi-page printable view of this section.

Return to the regular view of this page

Customization

Configure the site brand, navigation, layout, search, languages, versions, print output, and agent output.

Customization covers whatever applies to the whole site rather than to one page: how it looks, how readers find their way around, what it publishes besides HTML, and which languages and versions it serves. Most of it is a key in hugo.yml; the rest lives in data files under data/ and in your own stylesheets under assets/. To write a page and set its front matter, see Authoring.

Find it by what you want to change

I want to change… Read
The site name, logo or favicon Brand and appearance
Colors, light and dark mode, fonts Brand and appearance
The navbar menu and its dropdowns Navigation and menus
Sidebar width, icon density or outline depth Layouts and page types
The home page and landing pages Home and landing pages
Full-text search and what it indexes Search
What the command palette offers Command palette
Keyboard shortcuts Keyboard navigation
The languages the site publishes Languages
Several versions of the docs, or the archive banner Versions
Tags and categories Taxonomies
“Edit this page”, last-modified dates and contributors Repository links and page info
Printing a page or a whole chapter Print
What AI agents read: llms.txt and per-page .md files AI-agent support
Any parameter’s type and default Configuration
Comments, analytics or the deployment target, which need an outside service Operations

1 - Configuration

Find every site parameter that the theme reads, with its type, default, description, and related guide.

Every site-wide setting OINK reads lives in hugo.yml and appears in a table on this page with its type, its default and a link to the guide that shows it in use. The defaults are conservative: local search, image zoom, comments, page feedback and the light/dark menu stay off until you turn them on, so your configuration only needs the keys you want to change. There is no master switch and no params.oink.* namespace, so a key that is not on this page does nothing. Settings for a single page are in Page parameters.

An empty Default cell means the theme has no default and the feature stays off until you set the key. Each group has its own anchor, such as /docs/customize/config/#sidebar.

The layers of hugo.yml

Configuration keys come in four layers, and the layer tells you where a key’s behavior is documented:

Layer Examples Who defines it
Hugo’s own top-level keys baseURL title languages markup outputs taxonomies module Hugo itself. See gohugo.io for behavior
Top-level params logo offline_search github_repo version page_width comments Site-level options the theme reads
params.ui.* navbar_enabled sidebar_width_min typography pager_types The shell, navigation and reading interface
params.<runtime> mermaid plantuml drawio markmap Each content runtime’s own switch and endpoint

A working site needs only the first two layers, including the Goldmark settings that OINK’s Markdown components depend on:

hugo.yml
title: Product Docs
baseURL: https://docs.example.com/
defaultContentLanguage: en
enableGitInfo: true

markup:
  goldmark:
    renderer:
      unsafe: true
    parser:
      attribute:
        block: true
      wrapStandAloneImageWithinParagraph: false
  highlight:
    noClasses: false

module:
  imports:
    - path: github.com/pgsty/oink

params:
  offline_search: true
  github_repo: https://github.com/example/product-docs

When a value is wrong

OINK checks every value it reads. When it cannot use one, such as a misspelled choice, a string where a boolean belongs, or a color that is not hex, it prints a warning that names the key, the value and the fallback, then continues with the documented default:

WARN invalid params.ui.typography "solarized" (allowed: technical | system) -- using "technical"

The site keeps building, so a typo under hugo server changes one setting instead of taking every page down. The same applies to front matter overrides, where the warning also names the page. Read the warnings after each change, because a warning usually means a feature you expected is running on its default or is switched off; Verifying a configuration change lists the common ones. For the same reason, leave Hugo’s --panicOnWarning off: OINK reports fallbacks as warnings on purpose, and the flag would turn each one into a failed build.

Features that depend on an outside service stay off until their configuration is complete. Draw.io without drawio_server, maps without tiles and attribution, Algolia without all three keys and giscus without its four required values each warn and render nothing; the theme never substitutes a public service of its own choosing. Upstream attribution that is missing required fields also warns and is left out entirely, because a partial credit line would look complete.

One check keeps your value. If theme_color reads below 4.5:1, the AA contrast for body text, against the theme’s canvas, the color still ships, since a custom canvas or a brand rule may justify it. The warning prints an ignoreLogs id you can add to silence it. Only a value that is not a hex color is dropped, leaving the default palette.

Hugo itself can still stop a build when a content reference resolves to no page.

Page-level override precedence

Most parameters can be overridden for one page or a whole section. Hugo’s .Param lookup takes the first value it finds, in this order:

  1. The page’s own front matter;
  2. cascade in an ancestor section’s _index.md (the nearest wins);
  3. Site params.

Drop the ui. prefix in front matter. The site key params.ui.reading_time becomes reading_time on a page. The theme silently ignores a ui: block in front matter, so when an override seems to have no effect, check the key name against Page parameters first.

content/docs/wide-reference.md
---
title: Wide reference
page_width: wide
navbar_enabled: false
footer_style: slim
reading_time: false
---

A cascade sets a whole subtree at once:

content/docs/_index.md
---
title: Docs
cascade:
  type: docs
  footer_style: slim
  feedback: true
---

Override where the content genuinely differs. A page that rebuilds its own visual system out of overrides tends to drift out of step with the rest of the site after a theme upgrade.

The three Goldmark prerequisites

Hugo does not merge a theme module’s markup settings into the site, so these lines belong in your own hugo.yml:

hugo.yml
markup:
  goldmark:
    parser:
      # block images may carry an attribute line ({caption=…}, numbered figures)
      wrapStandAloneImageWithinParagraph: false
      attribute:
        block: true
    renderer:
      # HTML emitted by `{{% … %}}` shortcodes has to survive
      unsafe: true
    extensions:
      passthrough:
        enable: true
        delimiters:
          block: [['\[', '\]'], ['$$', '$$']]
          inline: [['\(', '\)']]
  highlight:
    # class-based highlighting, so light and dark can each have a palette
    noClasses: false
  tableOfContents:
    endLevel: 4

The first three settings are the prerequisites every OINK site needs; the rest switch on math, theme-aware highlighting and a deeper outline. Each one shows a visible symptom when it is missing:

Setting Without it
parser.attribute.block: true Attribute lines such as {.fields}, {.steps} and {caption=…} print as literal text
parser.wrapStandAloneImageWithinParagraph: false A standalone image cannot take an attribute line, so captions and numbered figures do not work
renderer.unsafe: true Hugo escapes the HTML that steps, cards and {{% … %}} shortcodes produce
extensions.passthrough \(x\) and $$…$$ stay as text instead of becoming formulas
highlight.noClasses: false Code is colored with inline styles, so it cannot switch palette with dark mode
tableOfContents.endLevel: 4 Optional: without it the outline stops at ### headings

renderer.unsafe: true also lets raw HTML in Markdown through. That suits a team writing its own documentation, but it is not a filter: if the site publishes contributions from untrusted authors, review them before they merge.

Site identity and brand

Hugo’s own keys name the site and turn on Git metadata:

title , string
Site name, shown in the navbar, <title> and the footer
baseURL , string
The production domain. Include the path segment for a subpath deployment
copyright , string
Fallback copyright line, rendered as HTML when params.copyright is unset
enableGitInfo , boolean , defaultfalse
Needed for “last modified” dates and commit information
enableRobotsTXT , boolean , defaultfalse
Generates robots.txt
enableEmoji , boolean , defaultfalse
Allows :smile: emoji shortcodes

The theme’s keys add the logo, footer text and accent color:

params.logo , string , defaulticons/logo.svg
Brand mark, from an assets/ resource or a static/ path. See Brand and appearance
params.wordmark , string
Horizontal wordmark shown beside the logo in place of the site name. Below 992 px the navbar shows the logo alone
params.description , string
Site description, used as the meta description when a page has none
params.copyright , string or map
A string renders as Markdown. A map takes authors, from_year and to_year; present means the current year
params.footer_center_info , string , defaultPowered by Oink
Inline Markdown in the middle of the footer. An empty string hides it
params.author , string or map
The RSS author. A map takes name and email
params.ui.theme_color , string
#rgb or #rrggbb accent for the shell’s colored backgrounds. Prose links and inline code keep their own colors. See Brand and appearance
params.ui.theme_color_dark , string , defaultderived
The dark-mode accent. When omitted, the theme lightens theme_color until it meets AA contrast on the dark canvas

Favicons have no parameter: the theme picks up the conventional file names in static/ (favicon.ico, favicon.svg, favicon-NxN.png, apple-touch-icon.png, apple-touch-icon-NxN.png). See Brand and appearance.

Shell types and section roots

The reading shell follows a page’s type, not its folder, so documentation can live in any directory as long as a cascade gives it type: docs.

params.ui.shell_types , list , default[docs, book, blog, swagger, expo]
Types that get the reading shell with a sidebar. See Layouts and page types
params.ui.docs_section , string , defaultdocs
Folder name of the documentation section, used only to resolve navigation
params.ui.blog_section , string , defaultblog
Folder name of the blog section
params.ui.docs_sidebar_root , enum , defaultsection
Where a docs sidebar starts: section at the documentation section, home at the site home
params.ui.quick_links , list , default[docs_section, blog_section]
Top-level menu identifiers the command palette lists before you type. See Command palette
params.ui.sidebar_root_enabled , boolean , defaulttrue
Lets a subsection become its own sidebar tree with sidebar_root_for: self
params.ui.sidebar_root_menu , boolean , defaulttrue
Section switcher above the sidebar. With a single entry it becomes a plain link
params.ui.section_index , enum , defaultlist
How a section index lists its children: list or cards. Overridable per section
params.ui.section_index_columns , integer , default2
Columns when section_index: cards

Expo albums

Site-wide defaults for Expo albums. A page’s own expo block replaces this block as a whole and takes built-in defaults for the fields it leaves out, and a reader’s saved mode and size override both. The complete rules are in Expo defaults.

params.ui.expo.images , string , defaultimages/*
Pattern that selects the image resources in the page bundle
params.ui.expo.mode , enum , defaultwall
wall, cards or seamless
params.ui.expo.size , integer , default240
Target tile size, from 160 to 360 CSS pixels

Blog

These keys shape the section named by params.ui.blog_section, and each can be overridden for one section through front matter or a cascade on the blog root. The blog layout guide compares the four index layouts side by side.

params.ui.featured_image , enum , defaultnone
How a post’s featured image appears on its page and in section indexes: none shows nothing, banner a 16:9 figure above the title, wash the image behind the article header at one-tenth opacity, hero a full-bleed background behind the shell that moves the opening down. It is the same image as the post card and og:image, so the three always agree. Without an image, every mode shows nothing
params.ui.blog_index , enum , defaultlist
list horizontal entries, cards image cards, table compact rows, gallery linked covers. All are newest first; table always lists the whole section on one page
params.ui.blog_index_columns , integer , default3
Columns for blog_index: cards from the xl breakpoint up. Between md and xl there are always two columns, below md one
params.ui.blog_index_size , integer , default12
Posts per page for list, cards and gallery, and for all four layouts when blog_index_toggle is on. A standalone table ignores it
params.ui.blog_index_toggle , boolean , defaultfalse
Publishes all four layouts and lets readers cycle list → cards → table → gallery, remembering their choice. When false, only the configured layout is published
params.ui.blog_gallery.mode , enum , defaultwall
Tile arrangement inside gallery: wall with 6px gaps, seamless with none, cards as a masonry with visible captions. Independent of blog_index
params.ui.blog_gallery.size , integer , default240
Target gallery tile size, 160–360 CSS pixels. It does not change the number of posts per page
params.ui.toc_style , enum , defaultfixed
Right-rail presentation: fixed pins a panel to the viewport; flow uses a wider panel that starts level with the article and pins only once you scroll
params.ui.toc_taxonomies , boolean , defaulttrue
Taxonomy term clouds in the right rail. A rail with neither an outline nor clouds is not rendered

A page or cascade blog_gallery block replaces the whole site block. Fields it leaves out take wall and 240. A reader’s saved arrangement and size override the author’s defaults and are kept separately from Expo preferences. See Gallery.

Authors and series are taxonomies rather than parameters; see Taxonomies and Writing a blog.

The navbar, the footer and the page-action menu at the right end of the breadcrumb row:

params.ui.navbar_enabled , boolean , defaulttrue
Whether the site navbar renders. A page overrides it with a top-level navbar_enabled. See Navigation and menus
params.ui.navbar_autohide , boolean , defaultfalse
The navbar slides up out of view and returns when the pointer reaches its wake zone at the top. Inactive below 768px and on coarse pointers
params.ui.footer_style , enum , defaultfat
fat is a multi-column grid plus the copyright line, slim the copyright line only, none nothing
params.ui.dark_mode , boolean or map , defaultfalse
true turns on the dark palette and the light/dark control. { show_menu: true } implies enable: true; { enable: true, show_menu: false } keeps the palette without showing the menu control
params.ui.breadcrumb , boolean , defaultper-shell (true; false in blog)
Breadcrumbs above the title. A top-level section never shows a one-level breadcrumb
params.ui.page_context_menu.enable , boolean , defaulttrue
The page-action split button at the right end of the breadcrumb row
params.ui.page_context_menu.assistant_links , boolean , defaultfalse
Adds “Open in ChatGPT” and “Open in Claude”. A click sends the page’s full URL to that site
params.ui.page_context_menu.links , list , default[]
Your own external actions. url may use the {url}, {title} and {markdown_url} placeholders
params.ui.github_stars , string or number
Star count on the navbar GitHub mark. It is a constant you write; the page makes no request
params.ui.alt_site , map
Link to a sibling site in a single-language footer. Needs both label and an absolute http(s) url

The fat footer’s columns come from data/footer/<language>.yaml, not from a parameter; see Navigation and menus.

Sidebar

How the left navigation tree renders. Its structure comes from the content/ folders (Organizing content), and Layouts and page types shows these keys in use.

params.ui.sidebar_menu_compact , boolean , defaulttrue
Expands only the current branch and its neighbours
params.ui.sidebar_menu_foldable , boolean , defaulttrue
Lets the reader expand and collapse sections
params.ui.sidebar_menu_truncate , integer , default2000
Most entries rendered in one section; the rest are cut
params.ui.sidebar_cache_limit , integer , default500
From this page count on, pages that share a language, sidebar root and effective settings reuse one copy of the navigation markup, and the browser marks the active entry
params.ui.sidebar_width_min , integer , default220
Narrowest width, in pixels, the reader can drag the sidebar to on the desktop
params.ui.sidebar_width_max , integer , default480
Widest width, in pixels, for drag-resizing
params.ui.sidebar_item_overflow , enum , defaultellipsis
A long title is cut with ellipsis or wraps with wrap
params.ui.sidebar_icon_policy , enum , defaultall
Icon density: all everywhere, groups only on the root and on entries with children, none nowhere
params.ui.sidebar_expand_levels , integer , default2
Tree levels expanded by default
params.ui.sidebar_headings , boolean or integer , defaultfalse
type: book only: shows the current page’s headings as a branch under its sidebar row. Takes an integer from 2 to 4; true means 2
params.ui.sidebar_enabled , boolean , defaulttrue
The left sidebar. Usually turned off per page rather than for the whole site
params.ui.taxonomy_icons , map , defaultbuilt-in
Icons per taxonomy, keyed by plural. Each taxonomy has two: taxonomy for the whole classification, such as a right-rail cloud heading, and term for one term’s badge. A string such as tags: fa-solid fa-tags sets both; a map with taxonomy and term sets them separately, and a key it leaves out keeps the built-in. Built-in pairs cover tags, categories, modules, authors and series; any other taxonomy uses a generic shapes icon

Table of contents

Hugo decides which heading levels the right-hand outline collects; the theme only controls how it follows your reading. Hide the outline on one page with notoc: true (Page parameters).

markup.tableOfContents.startLevel , integer , default2
Hugo’s own: the highest heading level collected
markup.tableOfContents.endLevel , integer , default3
Hugo’s own: the lowest heading level collected
params.ui.scroll_spy , boolean , defaultfalse
No effect: the outline always highlights the current heading. Safe to delete from older configurations

Pager and page end

The blocks at the end of a page always come in the same order: share, feedback, page information, pager, comments. Each has its own switch. Backlinks sit in the right rail beside the outline.

params.ui.share , list , default[]
Share targets at the page end, in the order listed, chosen from x bluesky mastodon facebook linkedin reddit hackernews telegram whatsapp line pinterest weibo chatgpt claude email copy. An empty list hides the bar. Each target is a plain link, with no SDK, iframe, third-party script or share count. An unknown target warns and is dropped. See Writing a blog
params.ui.pager_types , list , default[docs, book, blog]
Types that show previous and next links. Turn them off on one page with pager: false. An unknown type warns and is dropped
params.ui.annotation , boolean , defaulttrue
The “last modified” and provenance block at the end of the body. Upstream attribution comes from the page’s upstream_link keys; see Page parameters
params.ui.backlinks , boolean , defaultfalse
A “Backlinks” group in the right rail listing the pages that link here, worked out at build time from ordinary links. See Navigation and menus
params.ui.compare , boolean , defaultfalse
Duo View: two panes side by side on Docs, Book and blog pages that have an HTML translation on the same site. A language can set it to false to opt out. See Duo view
params.ui.translation_notice , language code or false , defaultfalse
The language code of the authoritative version, so that a translated page shows a line pointing back to it. A page opts out with translation_notice: false
params.ui.reading_time , boolean , defaultfalse
Reading time under the page title
params.ui.book_draft_banner , boolean , defaultfalse
A banner at the top of a draft Book page

Local search is off by default. Turning it on also brings up the command palette, which opens from the navbar magnifier, Cmd/Ctrl with K, / and \.

params.offline_search , boolean , defaultfalse
Builds one local index per language and turns on the command palette. See Search
params.offline_search_on_serve , boolean , defaulttrue
Builds the index under hugo server too, so the preview searches like production. On a very large site, false speeds up local rebuilds
params.offline_search_index , enum , defaultcontent
How much of each page is indexed, each level adding to the one before: title, heading, summary, content
params.offline_search_summary_length , integer , default70
Length, in characters, of the excerpt stored for each page; a result shows it when no passage matches
params.offline_search_max_results , integer , default10
Most page results one search returns
params.ui.landing_search , boolean , defaulttrue
Keeps a search entry point on layout: landing pages
params.ui.command_palette.commands , list , default[]
Your own palette commands, each with either a url or a built-in action. See Command palette
params.gcs_engine_id , string
A Google Programmable Search engine ID. Searches then go to Google
params.search.algolia , map
Algolia DocSearch. appId, apiKey and indexName are all required

A custom command takes only seven keys: id, title, description, icon, keywords, url and action. The id must match ^[a-z][a-z0-9_-]*$ and must not repeat a built-in action ID. Put per-language titles under languages.<lang>.params.ui.command_palette.commands.

Keyboard

params.ui.keyboard_nav , boolean , defaulttrue
Twenty-nine single-key shortcuts for navigation, page actions and the view, plus the browsing history and the reader’s column width. With false, the runtime is left out of the page, so nothing is bound, recorded or restored. See Keyboard navigation

Image zoom

params.ui.image_zoom , boolean , defaultfalse
Lets body images open full size. A page overrides it with image_zoom in front matter

Images explains which images can be zoomed.

Typography

The visual preset, the fonts and the page widths:

params.ui.preset , enum , defaultpaper
Site-wide look: paper or slate, or the explicit experiments github, ink, news and terminal
params.ui.preset_menu , boolean or list , defaultfalse
true lets readers choose Paper, Slate or the site default. A list names the presets offered, may include the experiments, and must include the site default. Independent of dark_mode
params.ui.typography , enum , defaulttechnical
technical uses the selected preset’s bundled fonts (Paper: Plex Sans; Slate: Inter); system uses the platform font stack and requests no brand font
params.ui.fonts , map
Font-family names for the ui, body, heading, code, display, meta, brand and print roles. The theme checks the names but loads no font files. End each list with a generic family
params.page_width , enum , defaultnormal
Overall shell width: normal, wide, full. Overridable per page
params.reading_width , enum , defaultnormal
Body text width on Book pages: slim, normal, wide. The shell is unaffected

params.ui.fonts suits faces that are already on the reader’s system or that the site declares with @font-face. To ship font files with the site or change finer typography, use the project stylesheet; see Brand and appearance.

Comments and feedback

Comments use giscus, which keeps each page’s discussion in a GitHub repository; page feedback is two buttons with no backend of its own.

params.comments.enable , boolean , defaultfalse
Site-wide comment switch. A page overrides it with comments in front matter. See Comments
params.comments.type , string , defaultgiscus
Only giscus renders today
params.comments.giscus.repo , string
The GitHub repository that holds the discussions; required
params.comments.giscus.repoId , string
The repository ID; required
params.comments.giscus.category , string
The discussion category name; required
params.comments.giscus.categoryId , string
The discussion category ID; required
params.comments.giscus.mapping , string , defaultpathname
How pages map to discussions
params.comments.giscus.term , string
The discussion title or number when mapping is specific or number. Omitted when unset
params.comments.giscus.strict , string , default0
Strict title matching
params.comments.giscus.reactionsEnabled , string , default1
Shows reactions on the main post
params.comments.giscus.emitMetadata , string , default0
Sends discussion metadata to the parent page
params.comments.giscus.inputPosition , string , defaulttop
Whether the input box sits above or below the comments
params.comments.giscus.theme , string , defaultauto
The giscus theme. auto follows the site’s light/dark state
params.comments.giscus.lightTheme , string , defaultOINK palette
giscus theme name or custom CSS URL for light mode. By default, OINK’s own stylesheet for the active preset, so comments match the page
params.comments.giscus.darkTheme , string , defaultOINK palette
giscus theme name or custom CSS URL for dark mode. By default, OINK’s own stylesheet for the active preset
params.comments.giscus.loading , string , defaultlazy
lazy requests the giscus script only when the reader nears the comments, except on return from GitHub sign-in; eager requests it at once
params.comments.giscus.lang , string , defaultderived from the site language
The giscus interface language. When unset, Chinese sites resolve to zh-CN, zh-TW or zh-HK and other languages use their base code; a language giscus does not support falls back to en
params.comments.giscus.ariaLabel , string , defaulttranslated
The comment container’s aria-label. The default is “Comments” in the page’s language
params.comments.giscus.errorMessage , string , defaulttranslated
Text shown when loading fails. The default is “Comments could not be loaded.” in the page’s language
params.ui.feedback.enable , boolean , defaultfalse
“Was this page helpful?” buttons at the page end. There is no backend; when gtag is present, each answer is recorded as a structured event
params.ui.feedback.reasons , boolean , defaulttrue
Offers four optional reasons after “no”

Without all four required giscus values, the page has no comment section. Comments shows where to find them.

Repository links and page information

Links from each page back to its source, and the information block at its end:

params.github_repo , string
URL of the repository that holds the content. Drives “Edit this page”, “View edit history”, “Create child page” and “Create docs issue”. See Repository links and page info
params.github_project_repo , string , defaultgithub_repo
URL of the product repository, for “Create project issue” and the navbar GitHub entry
params.github_branch , string , defaultmain
The branch that edit links point at
params.github_subdir , string
The content site’s subdirectory inside a monorepo
params.path_base_for_github_subdir , string or map
Rewrites source paths (normalized to /) before they become repository links. A map takes from and to. Content mounted from outside the repository needs an explicit mapping to a repository-relative path. See repository links
params.github_url , — , default—
Removed and ignored. Use params.github_repo
params.ui.lastmod_commit , enum , defaultsubject
What follows “last modified”: subject the commit subject, hash the short hash, none nothing
params.images , string array , default—
Site-wide social card: supplies og:image for pages without their own image. Metadata only; never shown as a list thumbnail
params.upstream_source , string , default—
Default data/upstreams record for pages that declare upstream_link. A page’s front matter can override it
params.upstream_modified , boolean , defaultfalse
Site default for whether attributed material has been adapted. A page can override it. Nothing renders without upstream_link
params.default_featured , — , default—
Removed and ignored. Use params.images, or images in a section cascade

Content runtimes

Mermaid, KaTeX, ECharts, Infographic, Asciinema, Swagger UI and Redoc load by themselves on the pages that use them, and only in HTML output, so they have no switch. The features below need one, mostly because they talk to a service you choose. PlantUML renders in the reader’s browser unless you set svg_image_url, which hands rendering to a server; PlantUML compares the two modes.

params.markmap , boolean , defaultfalse
Turns on the mind-map fence site-wide. See Markmap
params.mermaid , map
Configuration passed to mermaid.initialize(). Keys are lowercase. Dark mode overrides theme automatically
params.plantuml , boolean or map , defaultdisabled
true turns on local rendering; false turns off all PlantUML rendering
params.plantuml.enable , boolean , defaultfalse
Turns on local PlantUML rendering. See PlantUML
params.plantuml.svg_image_url , string
Optional PlantUML server endpoint. Without it, diagrams render in the browser
params.plantuml.svg , boolean , defaultfalse
Server mode only: inline SVG instead of an <img>
params.drawio.enable , boolean , defaultfalse
Adds an edit button to .drawio.svg images. See Draw.io
params.drawio.drawio_server , string
Address of the Draw.io editor. Required when enable is true
params.video_embeds , list , default[]
Platforms (youtube, bilibili, vimeo) whose player loads in place after a reader clicks a video card. Empty: cards only link out. See Video
params.map , boolean or map , defaultdisabled
Interactive maps above map place lists. See Map
params.map.enable , boolean , defaultfalse
Turns on interactive maps; needs tiles and attribution
params.map.tiles , string
HTTPS tile template with {z}, {x} and {y} ({s}, {r} and {-y} allowed; any other placeholder warns and the template is ignored). The theme names no tile service; required when enabled
params.map.attribution , string
The plain-text attribution the tile service requires. Required when enabled
params.map.attribution_url , string
Optional https:// URL turning attribution into a clickable link
params.map.dark_tiles , string
Optional tile template for dark mode
params.map.subdomains , string
Optional {s} subdomain characters as a quoted string (e.g. abcd, "01234567"); empty uses Leaflet’s abc
params.map.max_zoom , integer , default19
Highest zoom level, 1–22
params.map.loading , lazy | click , defaultlazy
Mount near viewport (lazy) or wait for a reader click (click)
params.highlight_classes , boolean , defaulttrue
Emits Chroma classes for syntax highlighting; false returns to Hugo’s inline styles
params.ui.code_copy , boolean , defaulttrue
Copy button on code blocks. false removes it site-wide; a fence’s own copy= still wins
params.ui.rich_copy , boolean , defaulttrue
Typeset HTML copy for article prose selections pasted into rich-text editors; overridable per page or cascade. See Copying into rich-text editors

Math needs no parameter, only the passthrough setting.

Output formats

The theme defines extra output formats but turns none of them on, because some are expensive to build and most sites need only a few. List the ones you want under outputs:

hugo.yml
outputs:
  home: [HTML, markdown, LLMS, NAVJSON]
  page: [HTML, markdown]
  section: [HTML, RSS, print, markdown]
Format Output Description
HTML index.html The interactive page; required
markdown index.md A plain Markdown version of each page. “Copy Markdown” and “View markdown” need it. See AI-agent support
LLMS llms.txt A plain-text site index for language models, usually on home only
LLMSFULL llms-full.txt Opt-in for a top-level section: its pages’ Markdown joined in sidebar order, one file per language
NAVJSON navigation.json Opt-in on home: the sidebar and pager tree as JSON, once per language, validated by schema/nav.v1.schema.json
print _print/index.html A whole section as one printable page. See Print
BookManifest book.json Optional JSON at a Book root for EPUB and PDF packaging tools. It is not an ebook itself
RSS index.xml Hugo’s own format. Add it to section to give each section a feed

LLMSFULL and BookManifest go in the front matter of the top-level section that publishes them, not in the site configuration, and NAVJSON belongs on outputs.home. AI-agent support and Books have complete examples.

Two parameters shape the print output:

params.print.toc , boolean , defaulttrue
A table of contents at the top of the print page. false leaves it out
params.print.section_break_wordcount , integer , default50
How many words a section needs before it starts on a new print page

Languages and versions

Languages are defined in Hugo’s own languages block, and the theme reads the translation links Hugo builds from it:

defaultContentLanguage , string , defaulten
The primary language, served without a path prefix
languages.<lang>.label , string
The language’s own name, shown in the language menu
languages.<lang>.locale , string
The full locale, used for <html lang> and SEO
languages.<lang>.weight , integer
Language order, which is also the cycle order when the reader clicks the language icon
languages.<lang>.title , string
The site name in that language
languages.<lang>.direction , string , defaultltr
rtl for a right-to-left language

Paired files, anchor alignment and fallback for untranslated pages are covered in Languages.

Version keys:

params.version , string
Identifier of this site variant; it need not be a Git ref. See Versions
params.version_menu , string , defaultVersion
Title of the version menu
params.version_menu_pagelinks , boolean
When switching version, try the same path on the target site first
params.versions , list
Version entries with version, url and kind; name: '---' is a divider
params.archived_version , boolean
Shows the “this is an archived version” banner at the top
params.url_latest_version , string
Link to the current version inside that banner
params.time_format_blog , string , default2006-01-02
Blog date format, overridable per language
params.time_format_default , string , default2006-01-02
Every other date format, overridable per language

Miscellaneous

taxonomies , map
Hugo’s own: turns on tag: tags and category: categories. See Taxonomies
params.taxonomy.page_header , list
Taxonomies shown in a post header. When unset, all of them
services.googleAnalytics.id , string
Hugo’s own: the analytics script is added to production builds only. See Analytics and SEO

Editor completion via generated schemas

The theme publishes JSON Schemas for its configuration, so your editor can complete keys, show each key’s documentation on hover and flag a wrong type as you type. schema/site-params.schema.json covers hugo.yml, and schema/front-matter.schema.json covers page front matter. Take them from the same release tag as the theme pinned in your go.mod, because keys change between releases.

With the VS Code YAML extension, map the site schema in your settings. This example uses OINK v1.8.0 and covers both common file names; replace the tag with the one in your go.mod:

.vscode/settings.json
{
  "yaml.schemas": {
    "https://raw.githubusercontent.com/pgsty/oink/v1.8.0/schema/site-params.schema.json": ["hugo.yml", "hugo.yaml"]
  }
}

To confirm the mapping works, give a boolean such as params.offline_search a string value for a moment: the editor should flag the type. Then put the valid value back. Front matter completion depends on your Markdown tooling; associate it with front-matter.schema.json in the same way. That schema does not enforce types, because keys such as share and theme_color also accept a bare boolean to opt out.

Verifying a configuration change

Build once after each configuration change:

hugo --printPathWarnings

The build is good when it ends with Total in … and prints no ERROR. Then read each WARN line; these are the common ones:

Warning fragment Cause
invalid params.ui.typography The only choices are technical and system
invalid params.ui.footer_style … (allowed: fat | slim | none) A misspelled footer style. When it comes from front matter, the warning names the page
invalid params.page_width … (allowed: normal | wide | full) A misspelled page width
invalid params.ui.section_index … (allowed: list | cards) A misspelled section index style
invalid params.offline_search_index The scopes are title, heading, summary and content
params.drawio.enable requires an explicit params.drawio.drawio_server Draw.io is enabled without an editor address
params.map.enable requires params.map.tiles … and params.map.attribution Maps are enabled without a complete tile service
params.map.tiles may use only the {s}, {z}, {x}, {y}, {-y} and {r} placeholders The template has a placeholder such as {apikey} that nothing fills; write the key into the URL
params.video_embeds must be a list of platforms Written as a single string or a boolean
params.search.algolia requires explicit appId, apiKey, and indexName One of the three Algolia values is missing
params.ui.image_zoom must be true or false Written as a string such as "true"
theme_color … is not a #rgb or #rrggbb hex color The value is not a hex color; the default palette stays
theme_color … reads at about N:1 against the theme's … canvas Advisory: the color still ships, and the message prints the id that silences it
theme_color_dark … has no theme_color to pair with Only the dark color was set. It is ignored, and both modes keep the default palette
command … must define exactly one of url or action A custom command has both url and action, or neither
invalid params.ui.sidebar_icon_policy …; using all A misspelled icon policy

Then check three things in a browser: one page in each language, one page without a translation to see the fallback, and links under the production baseURL, including any subpath the site is deployed under. Build with the same Hugo that builds the site in production; Get started lists the versions it needs.

2 - Brand and appearance

Give the site your name, logo, favicon, accent color and fonts, choose a visual preset, and add your own CSS.

A site starts to look like your own once it carries your name, your logo and your color. All three are settings in hugo.yml, so a first pass at a brand is one edit and a reload:

hugo.yml
title: Acme DB Docs

params:
  logo: images/acme-mark.svg # under assets/ or static/
  ui:
    theme_color: '#0f766e'
    dark_mode: true

Fonts, the overall look and the footer are settings too. For anything a setting cannot reach, write plain CSS in assets/css/project.css, which loads after the theme’s stylesheet. Leave the theme’s own files alone, because the next hugo mod get replaces them.

Site name

The site name appears in the navbar, the browser tab and the footer. On a multilingual site, give each language its own under languages.<lang>.title; the top-level title is the fallback for a language that sets none.

hugo.yml
title: Acme DB Docs

languages:
  en:
    title: Acme DB Docs
    label: English
    locale: en-US
    weight: 1
  zh:
    title: Acme DB 文档
    label: 简体中文
    locale: zh-CN
    weight: 2

Out of the box the navbar shows the theme’s mark, assets/icons/logo.svg, beside the site name. Replace either half by putting an image in the site’s assets/ or static/ directory and naming its path relative to that directory:

hugo.yml
params:
  logo: images/acme-mark.svg
  wordmark: images/acme-wordmark.svg # optional
  • params.logo is the square mark in the navbar, the sidebar header and the footer. A file under assets/ goes through Hugo’s resource pipeline; a file under static/ is published unchanged.
  • params.wordmark is an image of the name that takes the place of the site name text next to the mark. The navbar draws it 16px tall and, like the site name, hides it below 992px, leaving the mark alone, so the wordmark should contain the name only. The footer shows it on its own unless the footer data names a logo.

Crop the SVG tightly around the artwork and give it a viewBox, or it will not line up with the text beside it. The theme places both images with <img>, which page CSS cannot recolor and in which currentColor resolves to black. Choose colors that read on both the light and the dark canvas, or do what the theme’s own mark does: put a <style> inside the SVG with a @media (prefers-color-scheme: dark) rule. That rule follows the reader’s system setting, not the site’s light/dark toggle.

Favicon

There is no favicon setting. The theme looks in the site’s static/ directory for the conventional file names and adds a <link> to every page for each one it finds:

static/favicon.ico
rel="icon"
static/favicon.svg
rel="icon" type="image/svg+xml"
static/favicon-32x32.png
rel="icon" type="image/png" with sizes; several sizes are linked smallest first
static/apple-touch-icon.png
rel="apple-touch-icon"
static/apple-touch-icon-180x180.png
rel="apple-touch-icon" with sizes

favicon.ico, favicon.svg and apple-touch-icon.png are enough for every browser. A file with a size in its name must be square (NxN); the theme ignores any other.

Other head metadata, such as a Web App Manifest, goes in layouts/_partials/hooks/head-end.html. To look in another directory or accept other names, override layouts/_partials/favicons.html in the site.

Accent color

The accent color marks where the reader is: the selected sidebar row and hover backgrounds, the outline’s current-section marker and its rail, tag and chip hovers, card borders and share buttons on hover, text selection, focus rings, and each section’s mark in the sidebar switcher. Set it with one hex value:

hugo.yml
params:
  ui:
    theme_color: '#0f766e'
    theme_color_dark: '#5eead4' # optional

It is most useful per section. Put the pair in a section root’s cascade and the whole section, its index page included, takes that color, so readers can tell Docs from Blog at a glance while the rest of the site keeps the default:

content/blog/_index.md
cascade:
  theme_color: '#6d28d9'
  theme_color_dark: '#a78bfa'

Prose links, external URLs and inline code keep the preset’s colors in every section, because a reader should recognize a link or an identifier the same way everywhere. To change those, override the palette.

theme_color_dark is optional. Without it, the theme lightens the light color toward white until it reaches AA contrast for body text on the dark canvas; set it yourself when the derived shade drifts from your brand. The light color is required: a theme_color_dark on its own, or next to an invalid theme_color, is ignored with a warning, so a page is colored in both modes or in neither.

To return one page to the default palette, set theme_color: false in its front matter; that drops the inherited dark color too, without a warning. Any other value that is not a #rgb or #rrggbb hex, such as a number, true or a color name, warns and keeps the default. Hugo merges parameters key by key, so a page that overrides only theme_color still inherits the section’s theme_color_dark: override both or neither.

The theme checks each color you write against its own canvases and warns when contrast falls below 4.5:1, the AA level for body text. The color is still applied, since a custom canvas or a fixed brand color may justify it, and the warning carries an ID you can add to Hugo’s ignoreLogs once you have checked it on the real background. A color that only just passes deserves a second look on interactive surfaces that use it for text over a 12% wash of itself, such as a linked badge; pick a darker shade if those read poorly.

Fonts

OINK bundles its Latin typefaces as local fonts served from your own site, so no page requests Google Fonts or any other font service. Chinese uses fonts already on the reader’s system, and the theme ships no Chinese font file. Each visual preset arranges the faces its own way:

Preset Interface and body text Headings Chinese
Paper IBM Plex Sans IBM Plex Sans Hei throughout
Slate Inter Inter; Chakra Petch for display titles Hei throughout
GitHub GitHub’s system font stack GitHub’s system font stack Hei throughout
Ink Palatino Palatino; italic for sections Kai headings and chrome over Fangsong text, or Song where they are missing
News A system serif Times New Roman, heavy Song throughout, heaviest in headlines
Terminal IBM Plex Mono, IBM Plex Sans in print IBM Plex Mono Hei throughout

Code is IBM Plex Mono and the wordmark Chakra Petch in Paper and Slate. Plex Sans and Inter include Latin, Cyrillic, Greek and Vietnamese. Chinese emphasis and quotations switch to Kai where the reader has it installed, so Han is never slanted; Terminal colors emphasis instead.

To use the platform’s own fonts and load none of the bundled ones, switch the typography policy:

hugo.yml
params:
  ui:
    typography: system # technical (default) | system

With system, every role uses the platform font stack. An invalid value warns and falls back to technical. The policy in effect is written to <html data-td-typography="…">.

Use fonts readers already have

To change a family without writing CSS, set params.ui.fonts:

hugo.yml
params:
  ui:
    fonts:
      # Body text and headings follow this face in every preset
      ui: "'Source Han Sans SC', 'PingFang SC', sans-serif"
      # Give monospace a CJK fallback, or mixed code blocks stop aligning
      code: "'Sarasa Mono SC', 'Noto Sans Mono CJK SC', monospace"

Setting ui changes body text and headings in every preset. Set heading to choose a separate face for headings. The other keys are listed under Font roles.

These values are family names, not files: the theme never downloads or loads a font because of this key. A family must already be on the reader’s system or declared by your own @font-face, so end every list with a generic family (sans-serif, serif, monospace) for readers who have neither.

A value may contain only font family syntax: quoted names, bare identifiers, a leading hyphen as in -apple-system, and names in any script (苹方 is a family name). Semicolons, braces, parentheses, url() and angle brackets are rejected. An unknown role or an unsafe value warns and drops that one entry; the rest of the map still applies. The theme writes these values after its stylesheet, so they win over both the preset and typography: system.

Bundle your own font

To ship a font file, or to give one kind of content its own face, use the project stylesheet. Put the .woff2 file in the site’s static/webfonts/, declare it, and point the roles at it:

assets/css/project.css
@font-face {
  font-family: 'My Sans';
  font-display: swap;
  font-style: normal;
  font-weight: 400 800;
  src: url('../webfonts/my-sans-variable.woff2') format('woff2');
}

:root {
  --td-ui-font-family: 'My Sans', 'Noto Sans SC', sans-serif;
  --td-body-font-family: var(--td-ui-font-family);
  --td-heading-font-family: var(--td-ui-font-family);
  --td-display-font-family: var(--td-heading-font-family);
}

Roles are ordinary inherited custom properties, so scoping one to a body class changes the face for that kind of page without touching component selectors:

assets/css/project.css
body.td-blog {
  --td-body-font-family: 'My Serif', 'Noto Serif SC', serif;
  --td-heading-font-family: var(--td-body-font-family);
}

A monospace stack needs a CJK fallback, or code that mixes Latin and Chinese stops aligning:

assets/css/project.css
:root {
  --td-code-font-family: 'My Mono', 'Sarasa Mono SC', 'Noto Sans Mono CJK SC', monospace;
}

Font roles

Eight CSS custom properties carry the font roles, and each can also be set by its key under params.ui.fonts:

Property Config key Where it is used
--td-ui-font-family ui Navigation, controls and interface text
--td-body-font-family body Body text and blog posts
--td-heading-font-family heading Headings in the body
--td-code-font-family code Code and terminals
--td-display-font-family display Display headings
--td-meta-font-family meta Technical labels and metadata
--td-brand-font-family brand Wordmark
--td-print-font-family print Print body text; follows body unless set

Visual presets

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

Preset Look
paper (default) Warm paper, ink text, blue links and accent, Plex Sans and framed tables
slate A cool blue-gray technical look
github (experimental) Markdown as GitHub shows a README: GitHub’s fonts and colors, ruled tables, alert colors and green buttons
ink (experimental) A written page on warm paper, Palatino and Kai throughout the chrome and headings, Fangsong or Song text, vermilion marks (emphasis dots, a first letter, the current row), brush-stroke rules and underlined prose links; at night gold and silver writing on indigo-violet paper
news (experimental) A printed page on grey newsprint: heavy Times New Roman and Song headlines, serif text and chrome, one spot blue, a masthead rule, a deck and dateline under the title, thick-and-thin section rules, pull quotes and open tables; at night a darkroom, silver type on black with a safelight orange
terminal (experimental) Monospace controls, headings and prose, teal links, amber accents and compact desktop navigation; at night a phosphor screen, grey type on black with green headings, links and cursor

Each preset’s dark mode keeps the fonts of its light mode but has a palette of its own, so switching to dark is a different experience rather than an inverted page.

params.ui.preset sets the site’s look. params.ui.preset_menu decides whether readers may choose another in the Appearance menu:

hugo.yml
params:
  ui:
    preset: paper
    preset_menu: [paper, slate, github, ink, news, terminal]
    dark_mode: true
preset_menu Readers can choose
false (default) Nothing; every page uses preset
true Paper, Slate and the site’s own preset
A list Exactly the listed presets; the site’s preset is added with a warning if missing

GitHub, Ink, News and Terminal appear only when you name them, as preset or in the list. The menu always lists them in the order of the table above. The experiment record lists what has been tested on Ink and Terminal. A reader’s style and light/dark choice are saved separately in the browser, and choosing the entry marked as the site default goes back to following the site. Print always uses a light palette on white paper.

Font settings and theme_color win in every preset. Dark palette overrides in your own CSS do not automatically: Paper scopes its dark palette to [data-td-preset='paper'][data-bs-theme='dark'], which outranks a bare [data-bs-theme='dark']. Write dark overrides as shown under Palette colors.

Light and dark mode

Sites are light-only until you turn dark mode on:

hugo.yml
params:
  ui:
    dark_mode: true

This adds the dark palette and a Light / Dark / System choice to the Appearance control in the navbar and footer, whose icon shows the reader’s choice: a sun for Light, a moon for Dark, and a half-filled circle for System, which stays while the system switches between modes. The control works with touch and keyboard and opens as a bottom sheet on phones. A reader’s choice is saved in the browser and shared across tabs; with no saved choice the page follows the system’s prefers-color-scheme. A small inline script applies the mode before the stylesheet loads, so pages never flash the wrong palette.

To support the dark palette for readers whose system asks for it, without showing the control, write dark_mode: { enable: true, show_menu: false }. If preset_menu still offers styles, the control stays and shows a palette.

hugo.yml
params:
  ui:
    footer_style: fat # fat | slim | none
  copyright:
    authors: '[The Acme DB team](https://example.com/)'
    from_year: 2026
    to_year: present
  footer_center_info: 'Powered by [Oink](https://oink.pgsty.com)'
footer_style Footer
fat (default) A grid of link columns above the copyright line
slim The copyright line only
none No footer

The link columns come from data/footer/<language>.yaml, described in Navigation and menus. Until that file exists, a fat footer renders as slim, so you can switch it on before you write the links. Front matter, or a section’s cascade, can set a different style (for example, slim on a focused reading section while keeping fat elsewhere). An unknown value warns and uses fat.

params.copyright is either a Markdown string or a map of authors, from_year and to_year, where present means the current year. footer_center_info is inline Markdown for the middle of the copyright line; set it to an empty string to leave that space blank.

Project stylesheet

Anything the settings above cannot reach is plain CSS in the site’s assets/css/:

File Use
project.css Your selectors and custom property overrides
project/*.css Optional further files, appended to project.css in path order

The theme publishes them as one stylesheet that loads after its own, minified, fingerprinted and with an integrity attribute in production. Because it is a separate file, editing your styles leaves the theme’s stylesheet, and the copy in readers’ caches, untouched.

Hugo minifies this file but does not compile it, so write CSS, not SCSS: // comments, Sass variables, mixins, @extend and &-suffix selectors do not work, and native CSS nesting reaches the browser as written. Relative URLs resolve from /css/, so ../webfonts/my-font.woff2 is the site’s static/webfonts/my-font.woff2. A site upgraded from an older OINK or from Docsy may still have files under assets/scss/; the build warns and ignores them until you convert them as described in Retired SCSS hooks.

Rely only on the public part of the theme’s CSS: the eight font roles and the --td-brand-* properties keep their names and meanings across minor releases. Component aliases such as --td-asciinema-font-family work only inside their component, and other variables, such as --td-shell-*, can change in any release. Use a variable where one exists, and otherwise the narrowest selector that works; overriding baseof.html to change a color makes every theme upgrade a merge.

To add a third-party stylesheet, copy it into the site and publish it as a local resource from layouts/_partials/hooks/head-end.html, not with a <link> in Markdown. Keep stylesheets and fonts local rather than pointing at a CDN, so the site keeps working when that host does not.

Palette colors

Colors other than the accent are CSS custom properties that you override in the project stylesheet. Each preset sets them in light and dark, so override both modes together, or one mode keeps the preset’s color.

Links use Bootstrap’s link tokens, --bs-link-color and --bs-link-hover-color with their -rgb twins. Bootstrap components such as buttons use the semantic colors; override the property, and the button variables that hold the color as a fixed value:

assets/css/project.css
:root,
[data-bs-theme='light'] {
  --bs-primary: #315f8f;
  --bs-primary-rgb: 49, 95, 143;
}

.btn-primary {
  --bs-btn-bg: #315f8f;
  --bs-btn-border-color: #315f8f;
  --bs-btn-hover-bg: #2a5179;
  --bs-btn-hover-border-color: #274c72;
}

The theme’s brand layer works the same way. Write the dark block with both selectors below: the bare one covers Slate, and the preset-scoped one is needed to outrank Paper’s dark palette.

assets/css/project.css
:root {
  --td-brand-copper: #a66722;
  --td-brand-mark-from: #1d588c;
  --td-brand-mark-to: #a66722;
}

[data-bs-theme='dark'],
[data-td-preset='paper'][data-bs-theme='dark'] {
  --td-brand-copper: #e0a35c;
  --td-brand-mark-from: #7fb8e8;
  --td-brand-mark-to: #e0a35c;
}
Property Used for
--td-brand-copper, --td-brand-copper-dim A warm secondary accent, used in the footer and Landing sections, and its muted form
--td-brand-mark-from, --td-brand-mark-to, --td-brand-mark-gradient The brand gradient, for example on the site name in the navbar
--td-brand-header-bg Navbar background
--td-brand-elev Overlay backgrounds
--td-brand-silk Secondary text
--td-brand-line-strong Strong rules
--td-brand-shadow-sm, --td-brand-shadow-md Shadows

Whatever you recolor, check hover, focus, disabled and selected states in both modes: body text needs 4.5:1 contrast and large text 3:1.

Styles for a site-owned shell

A page with its own layout, such as a hand-built home page, can use parts of the theme’s styling without the reading shell. Instead of main, the stylesheet every OINK page loads, such a layout asks for a smaller stylesheet by name:

chrome
Tokens, typography, the six palettes, the site navbar, and the language, theme and appearance controls
landing
The Landing sections; load it after chrome
search
The command palette and local search
compare
Duo View
layouts/_partials/my-head.html
{{ with partial "css/bundle.html" "chrome" }}
  <link rel="stylesheet" href="{{ (. | minify | fingerprint).RelPermalink }}">
{{ end }}

The partial returns a Hugo resource published as css/<name>.css, one directory below the site root, where its ../webfonts/… references resolve; your layout minifies and fingerprints it. An unknown name warns. These stylesheets follow the pinned theme version, so ask for them by name rather than copying them into the site, and do not read the layer files under the theme’s assets/css/td/, which can change in any release.

Verify

hugo --printPathWarnings
  • The build ends with Total in … and reports no ERROR. Read any warnings: a rejected color, font value or preset name is reported there and replaced by the default.
  • The navbar shows your logo and site name, the browser tab shows your favicon, and switching language switches the site name.
  • <html> carries the data-td-typography and data-td-preset values you set.
  • In dark mode, body text, tables, callouts, code blocks and focus rings are still readable. Check every color change in both modes and in each preset you offer.
  • In the browser’s developer tools, a paragraph’s font-family lists your family, and the rendered font is the file or system font you expect.

3 - Home and landing pages

Build the home page, or any product or pricing page, from sections listed in a YAML data file, with no template to write.

An OINK home page is data, not a template. data/home/<language>.yaml lists the sections from top to bottom (a hero, a grid of cards, pricing, a closing call to action) and holds the content of each, so you change the page by editing YAML and never touch HTML. Any other page can use the same sections as a landing page.

Edit the Starter’s home page

The OINK Starter ships a three-section home page in data/home/en.yaml. Replace the text and links with your own and the browser reloads with the result:

data/home/en.yaml
sections: [hero, cards, cta]

hero:
  align: center
  eyebrow: Open-source time-series database
  title_lines:
    - words: [{ text: Acme DB. }]
    - words: [{ text: Fast queries over years of metrics. }]
  lead: Install it, load your data and run your first query in ten minutes.
  actions:
    - { label: Install, url: docs/install/, icon: fa-solid fa-download, style: primary }
    - { label: Read the docs, url: docs/, style: ghost }

cards:
  eyebrow: Where to start
  title: Everything has a place
  columns: 3
  items:
    - title: Install
      desc: Packages for Linux and macOS, a container image, and a Helm chart.
      icon: fa-solid fa-download
      url: docs/install/
    - title: Query language
      desc: Every function and operator, with an example for each.
      icon: fa-solid fa-terminal
      url: docs/reference/
    - title: Release notes
      desc: What changed in each version, and how to upgrade.
      icon: fa-solid fa-tag
      url: blog/

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

Write internal links as site paths without a leading slash, such as docs/install/; the theme adds the language prefix, so the same link reaches /zh/docs/install/ from the Chinese home page. To add a section, append its name to sections and give it a key of the same name; to reorder the page, reorder the list. The section types table lists everything available.

Where the data lives

The home page’s content file holds only its title and description:

content/_index.md
---
title: Acme DB
description: An open-source time-series database
---

The sections live in one data file per language:

home page data

  • data/
    • home/
      • en.yamlEnglish home page
      • zh.yamlChinese home page

For each language the theme reads data/home/<language>.yaml, falls back to data/home/en.yaml, and on a single-language site accepts a plain data/home.yaml.

Each file has two levels: the sections list, and the keys it names. A section normally reads the key that matches its type; give it a key to read another, which is how one page shows two card grids:

data/home/en.yaml
sections:
  - hero          # reads hero:
  - cards         # reads cards:
  - type: cards   # a second card grid, reading release:
    key: release
  - cta

hero: { … }
cards: { … }
release: { … }
cta: { … }

Section entries

An entry in sections is either a type name or a map:

Key What it does
type The section type. If omitted, key is used as the type
key The top-level key that holds the data. Defaults to the type name; use it to tell two sections of the same type apart
data The section’s data inline, instead of under a top-level key
id The section’s anchor ID, generated from key or type by default
enabled: false Hides the section and keeps its data
partial Renders the data with one of the site’s own partials. This ties the data to your templates, so it no longer moves between sites

Type names use hyphens (logo-wall); underscores are accepted and normalized. A misspelled type warns with unknown section type and the section is skipped. A home page migrated from Docsy’s blocks/* shortcodes has to be rebuilt this way; see Migrating from Docsy.

Hero

The hero is the first screen, and the only section with a large title and an illustration:

data/home/en.yaml
hero:
  eyebrow: Acme DB 3.0 · Open source         # small text above the title, with a status dot
  title_lines:                               # the large title, one entry per line
    - words:
        - { text: Acme DB }
  lead: One sentence saying what this is.    # inline Markdown and <br> allowed
  note: Runs on a single binary              # a supplementary line with an icon
  note_icon: fa-solid fa-circle-check
  title_size: 4.25rem                        # rem, em or px only
  image:
    light: images/hero-light.webp
    dark: images/hero-dark.webp              # with only one, both modes use it
    alt: Query latency dashboard
  media:
    ratio: '1fr 240px'                       # column widths of text and image
    max_width: 240px
    hide_below: md                           # hide the image below sm | md | lg | xl
  actions:
    - { label: Get started, url: docs/install/, icon: fa-solid fa-rocket, style: primary }
    - { label: GitHub, url: 'https://github.com/example/acme-db', external: true, style: ghost }
  detail: { label: See a live demo, url: docs/demo/ }

An image path names a file under the site’s static/ or assets/; the example expects static/images/hero-light.webp and static/images/hero-dark.webp. The image is a CSS background: with alt its container is announced as an image with that label, and without alt it is hidden from assistive technology. Without title_lines the hero shows title, and without either it shows the site title.

align: center gives a text-only first screen, as in the Starter: the text block widens and centers, title lines are balanced, and note moves below the buttons. A centered hero cannot hold an image, so when both are present the theme warns and keeps start alignment and the image.

Section types

There are 22 section types. Every type except hero accepts the same heading fields, eyebrow, title and desc (or text), plus a class for your own CSS.

Type What it holds
hero The first screen: large title, buttons, an image that follows light and dark mode
metrics Numeric facts, with optional count animation and source links
capabilities Capabilities described one per row, alternating sides, each with a visual panel
principles Numbered product principles
cards A general card grid: features, use cases, entry points
logo-wall Tools and partners, as a grid or a pure-CSS marquee
gallery A wall of screenshots
testimonials Quotations with attribution
contributors People, roles, avatars and links
faq Questions and answers, collapsible or flat
markdown Free Markdown content
cta The closing call to action
pricing Pricing tier cards
pricing-compare A tier-by-feature comparison matrix
command-box One copyable command
steps An ordered procedure, optionally with commands
timeline Dated milestones
code-plate Code inside a presentation panel
preview Markdown source beside its rendered result
case-study A case: metrics, a quotation and its source
download One or more data/download/ records
bar-chart Numeric comparison drawn without chart JavaScript

Common sections

cards sets its column count with columns:

data/home/en.yaml
cards:
  title: Use cases
  columns: 4
  link_label: Learn more
  items:
    - title: Monitoring
      meta: Metrics
      icon: fa-solid fa-chart-line
      desc: Keep a year of per-second metrics queryable in milliseconds.
      url: docs/use-cases/monitoring/

capabilities gives each capability a row of its own with a visual panel beside it. visual.type is one of shell, components, code, image or card. In a components panel, items with url become links, and items with preset become in-place style switchers whenever params.ui.preset_menu offers that preset:

data/home/en.yaml
capabilities:
  eyebrow: Why Acme DB
  title: Built for data that only grows
  items:
    - ref: 01 / Operations
      title: One binary, no cluster to babysit
      url: docs/install/
      motto: From the first install to the hundredth upgrade
      bullets:
        - 'Rolling [upgrades](docs/upgrade/) without downtime'
        - 'Built-in [backups](docs/backup/) and point-in-time recovery'
      value: Teams spend their time on queries, not on the database.
      visual:
        type: code
        title: install.sh
        lines:
          - { class: c, prefix: '# ', text: One command, one running server }
          - { class: p, prefix: '$ ', text: acme-db start --data ./data }
          - { class: ok, prefix: '✓ ', text: listening on :5433 }

For a terminal session, use lines to colour the prompt or status prefix of each line. With the development theme, paste a source snippet into a YAML block string and set lang to its language. Omit lang for plain text.

data/home/en.yaml
      visual:
        type: code
        title: Python
        lang: python
        code: |
          import acme
          db = acme.connect("localhost:5433")
Minimal YAML for eleven more sections
metrics:
  title: Facts
  animate: true
  items:
    - { value: 2189, compact: true, label: Stars, source: { label: Local CI data, url: 'https://example.org/' } }
    - { value: 32, suffix: '+', label: Languages }

command-box:
  title: Install
  code: hugo mod get github.com/pgsty/oink
  lang: bash
  note: The copy button comes from the on-demand landing runtime.

steps:
  title: Three steps to publish
  items:
    - { title: Clone, desc: Copy the documentation site repository. }
    - { title: Configure, desc: Change three settings., cmd: { code: hugo server } }
    - { title: Publish, desc: Push to GitHub Pages. }

timeline:
  title: Project history
  items:
    - { date: '2024', title: Prototype, desc: The first data-driven sections. }
    - { date: '2026', title: Scenario components, desc: Landing becomes a reusable shell. }

code-plate:
  title: Page configuration
  aria_label: Example configuration
  lang: yaml
  code: |
    layout: landing
    landing: pricing

preview:
  title: What you write is what you get
  file: guide.md            # the filename in the source panel header, default page.md
  source: |                 # the right side renders this Markdown with the site's own hooks
    > [!TIP] Markdown only
    > Callouts, steps and tabs are all ordinary syntax.

    1. Write Markdown
    2. Run `hugo`
    {.steps}

case-study:
  title: Migration outcome
  stats:
    - { value: 12, label: Reusable sections }
    - { value: 0, label: Remote requests }
  quote: "One YAML file replaced a bespoke page template."
  source: A site maintainer

pricing:
  title: Pricing
  tiers:
    - name: Community
      price: Free
      period: forever
      desc: The full open-source capability.
      features: [Every component, Community support]
      cta: { label: Download, url: docs/start/ }
    - name: Professional
      featured: true
      price: $3.4K
      period: /year
      features: [Priority response, Release packages]
      cta: { label: Contact us, url: 'mailto:example@example.org' }

pricing-compare:
  title: Tier comparison
  tiers: [Community, Professional]
  groups:
    - name: Support
      rows:
        - { name: Priority response, cells: [N, Y] }
        - { name: Annual fee, price_row: true, cells: [Free, $3.4K] }

download:
  title: Download
  keys: [prd5]

bar-chart:
  title: Build time
  unit: seconds
  items:
    - { label: Cold build, value: 12.3, group: cold }
    - { label: Warm cache, value: 1.6, group: warm, note: A repeat build on the same machine. }

The download section reads the same data/download/<key>.yaml records as Releases and downloads, so a version number is written once for both.

Landing pages

A pricing page, a product overview or an event page can use the same sections as the home page. Two front matter lines turn an ordinary page into a full-width landing page that keeps the navbar, the command palette and the footer and drops the sidebar and outline:

content/pricing.md
---
title: Pricing
layout: landing
landing: pricing
---

landing: pricing names the data, which sits beside the home page’s and is split by language the same way:

landing page data

  • data/
    • landing/
      • pricing/
        • en.yaml
        • zh.yaml

A single data/landing/pricing.yaml also works: with sections at its top level it serves every language, and with one map per language code it works like the directory form. For a language tagged zh-cn, the theme tries zh-cn, then zh, then en. When it finds nothing, the page warns and renders the landing shell without sections.

A page with only a section or two can write them in its front matter instead, each with its data inline. Use either landing: or sections:, not both; with both, the theme warns and uses the inline sections.

content/pricing.md
---
title: Pricing
layout: landing
sections:
  - type: hero
    data:
      title: Acme DB Cloud, priced per node
      actions:
        - { label: Read the docs, url: docs/, style: primary }
  - type: cta
    data:
      title: Ready to start?
      label: Read the docs
      url: docs/
---

Landing pages show the search button and command palette when the site has local search on. To leave search off landing pages other than the home page, set params.ui.landing_search: false.

Languages and local facts

Put each language’s text in its own file (en.yaml, zh.yaml). A record that is mostly shared facts, such as a pricing tier, can instead carry per-language fields: the theme reads <field>_<language>, then <field>_<base language>, then <field>, with - in the language tag written as _. A page in zh-cn therefore reads title_zh_cn, then title_zh, then title. CamelCase suffixes are not recognized.

Section text is site data and does not go through the theme’s interface strings; only the theme’s own controls, such as the marquee’s pause button and pricing states, are translated by the theme. For the rest of a multilingual setup, see Languages.

No section fetches anything in the browser: prices, star counts, screenshots, avatars and download states must all be in the repository when Hugo runs. The same holds for the two navbar facts you can set in hugo.yml:

hugo.yml
params:
  ui:
    github_stars: 2189            # shown on the GitHub link; never fetched from GitHub
    alt_site: { label: 中文站, url: 'https://example.cn/' }  # sister-site link on a single-language site

The footer has its own data, data/footer/<language>.yaml or data/footer.yaml on a single-language site; see Navigation and menus. A footer key left in data/home/<language>.yaml is ignored with a warning that names the new location.

Output

  • HTML: every section rendered on the server, plus landing.js, loaded only when needed, for reveal effects, counters, copy buttons and light/dark image switching.
  • Print: the content, with moving parts such as the marquee laid out as a static grid and controls removed.
  • Markdown: titles, prose, lists, tables and code, without component classes.
  • RSS: no landing sections.

Without JavaScript, or if landing.js fails to load, every section is still visible: metrics already show their final formatted value, prefix and suffix, and the marquee’s pause control works without script. Readers who ask for reduced motion get no movement or reveal effects.

Verify

  1. Run hugo --printPathWarnings. Misspelled types, missing data keys and a page with both landing and sections are reported here.
  2. Open the home page and each landing page in every language, and compare the sections with their data files.
  3. Reload with JavaScript disabled; the content stays, only the motion goes.
  4. Switch between light and dark mode and check that image.light and image.dark each appear in the right one.
  5. On a site deployed under a subpath, check that internal links and images carry the prefix.

4 - Navigation and menus

Configure the navbar menu, dropdowns, section switcher, breadcrumbs, page actions, pager, and footer links.

The menu across the top of every page is the map of your site: the handful of places, such as Docs, Blog and Download, that a reader should reach from anywhere. You write it once per language in hugo.yml. The other ways of moving around (the section switcher at the top of the sidebar, breadcrumbs, previous and next links, backlinks) follow from your content tree, so you adjust them rather than build them. The sidebar tree and the page outline are covered in Layouts and page types.

The navbar menu

Top-level entries go in each language’s menus.main:

hugo.yml
languages:
  en:
    menus:
      main:
        - identifier: docs
          name: Docs
          pageRef: /docs
          weight: 20
        - identifier: blog
          name: Blog
          pageRef: /blog
          weight: 50
        - identifier: download
          name: Download
          pageRef: /download
          weight: 60
          params:
            icon: fa-solid fa-download

Entries appear in ascending weight. Point at your own pages with pageRef, so that Hugo resolves the page in each language and marks the entry active on every page beneath it, and use url for anything else. An external url opens in a new tab with rel="noopener noreferrer" and carries an external-link mark. Translate name in every language but keep identifier the same, because other settings refer to entries by it: params.ui.quick_links picks command palette quick links by identifier, and the default icon is matched against it.

A page can also add itself to the menu from its front matter, which is handy when the page itself is the top-level destination:

content/download/_index.md
---
title: Download
menu:
  main:
    weight: 30
---

The GitHub button at the right end of the navbar is not a menu entry, and a menu entry with the identifier github is skipped. The button links to params.github_project_repo, or to params.github_repo when that is unset, so change those to change it; see Repository links and page info.

Dropdowns

Give an entry a parent to place it in that entry’s dropdown panel:

hugo.yml
menus:
  main:
    - identifier: docs
      name: Docs
      pageRef: /docs
      weight: 20
    - identifier: docs-start
      parent: docs
      name: Get started
      pageRef: /docs/start
      weight: 10
      params:
        icon: fa-solid fa-rocket
    - identifier: docs-components
      parent: docs
      name: Components
      pageRef: /docs/components
      weight: 20
      params:
        icon: fa-solid fa-cubes

The panel is a single column with one icon and one name per row; it does not display a child’s params.description, and a params.columns setting is ignored with a build warning. The parent stays an ordinary link: hovering or focusing it opens the panel, while clicking it or pressing Enter opens the parent page. Touch readers therefore go straight to that page, so it should link to the same children, as a section index does by itself. With the keyboard, ↓ opens the panel and focuses its first item, and Esc closes it and returns focus to the parent; clicking outside also closes it.

Dropdowns go one level deep. A grandchild entry is rendered as a plain group heading inside the panel, not as a third-level flyout, and the build warns only one interactive child level is supported. Put deeper structure in the sidebar.

Menu icons

Below the lg breakpoint the navbar shows each top-level entry as its icon alone, so give every top-level entry one. An entry’s icon is the first of:

  1. the menu entry’s own params.icon;
  2. icon in the target page’s front matter;
  3. a built-in default matched against the identifier, the target’s section or the first segment of its URL (docs, guide, blog, news, examples, community, about, download, github);
  4. fa-solid fa-link.

An icon is one Font Awesome class pair; the theme ships the free icon set, so nothing is downloaded. Setting params.icon to false or "none" removes the icon, and the entry then keeps its text label at every width:

hugo.yml
menus:
  main:
    - identifier: handbook
      name: Operations handbook
      pageRef: /handbook
      weight: 40
      params:
        icon: false

Taxonomy menus

A top-level entry that points at a taxonomy list page such as /tags/ needs no children: its panel fills itself with the taxonomy’s terms and their page counts, most-used first. The entry is written like any other; see The taxonomy panel in the navbar.

Navbar controls

The 50px navbar holds the brand logo or wordmark at the start, the menu in the middle, and utility controls at the end. It adapts to the viewport in three tiers:

Viewport State
lg and above Brand, menu labels, and the search, version, language, appearance and GitHub controls. No drawer button
md to below lg Menu icons in the middle, utility controls at the end. No drawer button
Below md Menu icons in the middle; only search and a drawer button at the end. Version, language, appearance and keyboard help move to the footer’s bottom bar

The drawer button opens the sidebar on pages that have one, and a site menu on Home and Landing pages.

Menu entries never wrap onto a second line. When the brand, a fixed desktop sidebar and the utility controls leave too little room, entries with icons collapse to their icons first, while entries with params.icon: false keep their labels; whatever still does not fit folds into a trailing … panel that shows each entry’s icon, name and children.

Each utility control appears once its feature is configured: search with params.offline_search (Search), the version menu with params.versions (Versions), the language menu with two or more languages (Languages), and the appearance menu when the site offers a color-mode or preset choice (Brand and appearance).

Auto-hide

On long pages you can give the navbar’s space back to the content:

hugo.yml
params:
  ui:
    navbar_autohide: true

The hidden navbar keeps its 50px band, so nothing below it moves. Pointing into the upper 60% of that band, or tabbing into the navbar, fades it back in place without covering the page. The wake zone leaves out 64px at each side, so the buttons that restore a collapsed sidebar or outline stay clickable.

Auto-hide stays off below 768px and on coarse-pointer or touch-only devices, where the navbar is always visible. Home ignores the site setting unless its own front matter turns it on, and hero pages keep their overlay navbar, which scrolls away with the hero. A top-level navbar_autohide in page front matter or a section cascade overrides the site setting.

Turning the navbar off

For pages that need the whole viewport, such as a full-screen report or an embedded application, turn the navbar off for the site:

hugo.yml
params:
  ui:
    navbar_enabled: false

or for one page or section:

content/docs/_index.md
---
title: Docs
cascade:
  navbar_enabled: false
---

Without the navbar, the theme moves its essentials elsewhere: a mobile subnavigation, a brand and search row at the top of the sidebar, and the utility buttons on the outline rail. Readers lose the site menu, though, so reserve this for pages that need it rather than using it as a style choice.

The section switcher

The row at the top of the sidebar switches between whole trees: Docs, Blog, a Book, or any large subtree you promote to a root of its own. It lists every top-level section, then every section marked sidebar_root_for: self, without duplicates, and adds the root the reader is currently in when it is not already listed. Sections without a permalink (build.render: never) and divider groups never appear. With no entries the switcher is absent, with one it is a plain link, and with two or more it is a dropdown.

hugo.yml
params:
  ui:
    sidebar_root_enabled: true
    sidebar_root_menu: true

Both default to true. sidebar_root_menu: false removes the switcher. sidebar_root_enabled: false ignores sidebar_root_for, so every page shows the tree of its top-level section.

To make a large subtree, such as a versioned API reference or a self-contained handbook, a root of its own, mark its _index.md:

content/docs/api-v2/_index.md
---
title: API reference v2
sidebar_root_for: self
sidebar_root_link_self: true
---

With self, the section index and everything below it use the new tree; with children, the index stays in its parent’s tree and only its descendants switch. sidebar_root_link_self (default true) points the link at the top of the new tree to the section’s own index; set it to false to point that link at the parent section instead. The switcher picks the tree, and that root link opens a page in it.

To keep a top-level section or a self root out of the switcher, set sidebar_root_menu: false in its front matter. While a reader is inside that section, it still appears in the switcher to mark where they are.

Breadcrumbs and page actions

Above each page title, a breadcrumb shows where the page sits, using the localized linkTitle of each ancestor in the same hierarchy as the sidebar. The page action menu sits at the right end of the same row. A top-level section leaves out the one-item breadcrumb that would only repeat its title, and the action menu keeps its place. Blog pages show no breadcrumb by default, because a post reads as a standalone piece; set breadcrumb in front matter or a cascade to change that for a page or section, or turn breadcrumbs off for the whole site:

hugo.yml
params:
  ui:
    breadcrumb: false

The page action menu

The split button at the end of the title row gives readers what they can do with the page: take its content elsewhere, or change it at the source. Its left half copies the page’s Markdown and shows a green check mark when the copy succeeds; the arrow opens the full menu. Each entry appears only when the site can serve it, and each has a stable action ID that the command palette and custom CSS use:

Entry Action ID Appears when
Copy Markdown copy_markdown The page has the markdown output format
Open in ChatGPT open_chatgpt page_context_menu.assistant_links: true
Open in Claude open_claude page_context_menu.assistant_links: true
View markdown view_markdown The page has the markdown output format
View edit history view_history params.github_repo is set and the page’s source path resolves
Edit this page edit_page The same
Create child page create_child_page The same
Create docs issue create_issue params.github_repo is set
Create project issue create_project_issue params.github_project_repo is set
Print entire section print_section The section has the print output format
hugo.yml
params:
  ui:
    page_context_menu:
      enable: true
      assistant_links: false
      links: []

page_context_menu: false, for the site or in a page’s front matter, removes the button; the same actions stay in the command palette. The assistant entries are off by default because clicking one sends the page’s full URL, query and fragment included, to that third party. A page can switch them off but cannot switch them on when the site has not; AI-agent support covers the prompt they send and what to put in your privacy statement.

links adds your own external actions at the end of the menu. In url, {url} is the page’s full address, {title} its title and {markdown_url} the address of its Markdown version, each URL-encoded:

hugo.yml
params:
  ui:
    page_context_menu:
      links:
        - name: Ask the internal assistant
          icon: fa-solid fa-wand-magic-sparkles
          url: https://assistant.example.com/new?source={markdown_url}&title={title}

On the blog root and its first-level sections the left half is an RSS subscription link instead, and Copy Markdown moves into the menu. A page without Markdown output has no left half, and the arrow becomes a labeled “Actions” button.

The pager

Two text links at the end of the body lead to the previous and next page in the order of the visible sidebar tree, from the root page down to the last page. The root has no previous link and the last page no next link. When the site supplies data/docs_nav.json, that tree orders the pager and the section indexes it declares, so the sidebar, the pager and the index list children in the same order; other sections follow the content tree.

hugo.yml
params:
  ui:
    pager_types: [docs, book, blog]

pager_types accepts only docs, book and blog; any other value warns and is dropped. To remove the pager from one page:

content/docs/appendix.md
---
title: Appendix
pager: false
---

The same order goes into the page’s <head> as <link rel="prev"> and <link rel="next">, so browsers and crawlers can follow the reading sequence:

page source
<link rel="prev" href="/docs/customize/home/">
<link rel="next" href="/docs/customize/layout/">

Only HTML pages carry the pager and these links; print, Markdown and RSS output have neither. The pager is one of the blocks at the end of a page, which appear in a fixed order; see What the page end is made of.

Backlinks list the pages that link to the current one, so a reader who lands from search sees which pages consider it worth pointing to and where it sits in the rest of the site. They are off until you turn them on:

hugo.yml
params:
  ui:
    backlinks: true

A page overrides the setting with backlinks in its front matter, and a section passes it down with a cascade:

content/docs/_index.md
---
title: Docs
cascade:
  backlinks: true
---

The list appears in the right rail as an expanded “Backlinks” group, below the outline and above the taxonomy clouds; below xl it moves into the sidebar drawer with the outline. The first eight entries are visible and the rest sit behind a native “Show N more” disclosure, and hovering an entry shows its source page’s description. A page that nothing links to has no backlinks block at all, heading included. A non-boolean value warns and counts as off.

Hugo builds the list at build time from the ordinary Markdown links and ref / relref shortcodes you already write, so there is no new syntax and no JavaScript. Links inside code are ignored, as are self links, external links, mailto: and same-page anchors; several links to one page count once, and a fragment is ignored when matching the target. Each language has its own list, so a Chinese page never appears under an English one, and entries are sorted by page path, so the same content always gives the same order.

URLs in custom shortcode parameters or raw <a href> elements are not counted, and links that do not resolve are dropped silently. Backlinks help readers navigate; keep running a link checker to find broken links.

The page’s Markdown output carries the same list after a “Backlinks:” line; RSS and the print view leave it out. This site enables backlinks everywhere, so the right rail of this page shows a live example, and Configuration lists more than forty, most of them behind the disclosure.

params.ui.footer_style chooses fat, slim or none; see Brand and appearance. The link grid of the fat footer comes from data/footer/<language>.yaml, not from a menu (the theme has no menus.footer):

data/footer/en.yaml
brand:
  name: Product Docs
  tagline: A short description that **supports Markdown**.
  slogan: Close to the product, with clear answers.
columns:
  - title: Docs
    links:
      - { label: Get started, url: /docs/start/ }
      - { label: Components, url: /docs/components/ }
  - title: Project
    links:
      - { label: GitHub, url: https://github.com/pgsty/oink, external: true }
      - { label: Releases, url: /blog/release/ }
  • Without brand.name and brand.logo, the footer uses the site’s own brand name, logo and wordmark. tagline and slogan render Markdown.
  • An internal url resolves against the current language root. external: true opens the link in a new tab with rel="noopener noreferrer".
  • The grid has as many columns as the data has.
  • A single-language site can use data/footer.yaml.
  • A fat footer with no data falls back to slim, so you can switch it on before writing the data.

An arrow at the end of the fat footer’s copyright row collapses and restores the link grid. The grid starts expanded, and the reader’s choice is kept in localStorage under td-footer-collapsed across pages; it is independent of Zen Mode. slim and none have no such arrow.

The footer’s bottom bar ends with an icon dock holding, in order, the version, language, appearance and keyboard-help controls, followed by the fat footer’s collapse arrow. Their menus open upward. Hovering keyboard help previews the full three-column shortcuts sheet above the footer, and clicking it opens the centered modal dialog. The version button shows only an icon, while its choices keep their full labels. The sidebar does not repeat these controls, and footer_style: none removes the bottom bar together with the footer.

The copyright row and the note in its center are set in Configuration.

Verify

Build, then check the warnings and the rendered navigation:

hugo --printPathWarnings
  • No build warning says only one interactive child level is supported; if one does, a menu is nested three levels deep.
  • On desktop, hovering a parent opens its panel, clicking it opens its page, and Esc closes the panel.
  • Below lg, every top-level entry shows an icon; an entry without one is blank at that width.
  • Below md, the Home and Landing navbars keep only search and the drawer button at the end, and version, language, appearance and keyboard help are in the footer’s bottom bar.
  • The switcher at the top of the sidebar lists every top-level section and marks the current one.
  • On a documentation page, E / Q page through the sidebar order, and the page source has the matching rel="prev" / rel="next".
  • With backlinks on, grep td-backlinks public/<a page that is linked to>/index.html finds the block, and a page nothing links to has none.
  • The page action menu shows the entries you expect and nothing else; for example, Create project issue is absent without github_project_repo.

5 - Layouts and page types

Choose which shell a page renders in, and tune its sidebar, table of contents, section index and page width.

Every page renders in a shell: the reading shell, with a sidebar on the left and an outline on the right, or a plain single column. The page’s type chooses the shell, not the folder it lives in, so documentation can sit anywhere under content/. To give an operations handbook in content/handbook/ the documentation shell, set the type on its section and cascade it to every page below:

content/handbook/_index.md
---
title: Operations handbook
type: docs
cascade:
  type: docs
---

Where content goes and how the sidebar tree follows the folders is covered in Organizing content; this page covers the shell around it.

Shell types

type Shell
docs The reading shell: left sidebar with section switcher and page tree, the body, and the outline on the right
book The reading shell, plus numbered chapters, figures and tables, the reading_width measure and an optional draft banner
blog The reading shell, with blog sections expanded in the sidebar and the breadcrumb off; on blog index pages the page-action button leads with RSS
swagger The reading shell, with Swagger UI or Redoc rendering the body. See API reference pages
expo The shared sidebar and a full-width image album, without the outline. See Expo albums
Any other type A plain page: navbar, a single-column body and the footer, with no sidebar

Taxonomy and term pages, such as /tags/, also use the reading shell.

params.ui.shell_types lists the types that get the reading shell’s behavior; its default is the five types above:

hugo.yml
params:
  ui:
    shell_types: [docs, book, blog, swagger, expo]

If you override the list, keep those five in it, because the theme loads the shell’s scripts only for listed types. Listing a type of your own switches the shell’s behavior on for it but does not draw a sidebar unless your own templates for that type do; to make a section read like documentation, give it type: docs as above.

Section roots

hugo.yml
params:
  ui:
    docs_section: docs
    blog_section: blog

These keys name the top folders of the documentation and the blog. The theme uses them to find sidebar roots, the command palette’s quick links and default icons, but they do not choose the shell: the handbook above gets the documentation shell while docs_section stays docs.

A docs page’s sidebar normally starts at the documentation section. To start it at the site home instead, so it shows every top-level section:

hugo.yml
params:
  ui:
    docs_sidebar_root: home # home | section

Any other value warns and uses section.

Documentation at the site root

A site that is mostly documentation can serve it from the URL root, as /install/ rather than /docs/install/, while the source stays in content/docs/. It takes three changes, made together.

First, drop the docs/ segment from URLs with Hugo’s own permalinks:

hugo.yml
permalinks:
  page:
    docs: /:sections[1:]/:slug/
  section:
    docs: /:sections[1:]

Second, stop each language’s site root index (content/_index.md, content/_index.zh.md, …) from rendering, so it no longer competes with the docs section for the same output path while remaining a valid link target:

content/_index.md
---
title: Product Docs
build: { render: link }
---

Third, root the sidebar at the site home, so the sidebar and the previous/next links walk one tree:

hugo.yml
params:
  ui:
    sidebar_root_enabled: true
    docs_sidebar_root: home

With docs_sidebar_root: home, every top-level section joins that tree. Take out the ones that are not part of the reading order, such as the blog, a community page or downloads, with toc_root: true in their _index.md; they then appear neither in the tree nor in the paging order:

content/blog/_index.md
---
title: Blog
toc_root: true
---

The documentation now shares the URL root with every other section, so build with --printPathWarnings and resolve any duplicate target before you publish.

Landing pages

A page with layout: landing gets neither shell: it keeps the navbar and footer and fills the width between them with sections such as a hero, cards and pricing. See Home and landing pages.

Sidebar

The sidebar mirrors the folders under content/, ordered by weight and labeled with linkTitle where a page has one. These settings, shown with their defaults, tune how much of the tree is open and how wide it is:

hugo.yml
params:
  ui:
    sidebar_menu_compact: true
    sidebar_menu_foldable: true
    sidebar_menu_truncate: 2000
    sidebar_width_min: 220
    sidebar_width_max: 480
    sidebar_item_overflow: ellipsis # ellipsis | wrap
    sidebar_expand_levels: 2
  • sidebar_menu_compact opens only the branch of the current page and its neighbors; false opens the whole tree.
  • sidebar_menu_foldable lets readers open and close sections. Blog sections start open; set sidebar_expanded: false in a section’s _index.md to start it closed.
  • sidebar_expand_levels is how many levels are open by default.
  • sidebar_menu_truncate caps the entries rendered per section, which keeps the HTML of a thousand-page tree usable. When a section is cut, a build warning names it and the value it needs.
  • sidebar_width_min and sidebar_width_max bound the width, in pixels, that readers can drag the sidebar to on desktop. Double-clicking the divider restores the default.
  • sidebar_item_overflow: ellipsis cuts long titles short; wrap suits a site with many long titles, such as Chinese ones.

Each reader’s open sections, sidebar width and scroll position are kept in the browser, separately for each language. Below the md breakpoint the sidebar becomes a drawer with a backdrop.

On a large site, rendering every page’s sidebar separately slows the build. Once the site reaches params.ui.sidebar_cache_limit pages (500 by default), pages with the same effective sidebar settings share one cached tree, and the browser marks the current page and opens its ancestors. The shared tree is still complete and navigable without JavaScript. Below the limit, each page’s current position is rendered at build time. A Book page with sidebar_headings on always gets its own tree.

To remove the sidebar from one page:

content/docs/fullscreen-report.md
---
title: Full-screen report
sidebar_enabled: false
---

An explicit navigation tree, data/docs_nav.json

Use an explicit tree when the order of a manual comes from somewhere else, such as a Sphinx toctree you migrated and want to keep; when weight in content/ already gives the order, you do not need this file. The theme uses data/docs_nav.json instead of the folder tree when all three hold:

  • the file exists and has a sections key;
  • the page’s type is docs or book;
  • the page’s resolved sidebar root is not the site home.

The file is a tree of nodes. Each node’s page names a content path and its children are its children in the navigation. The theme resolves links and the current branch from page identity; url and the active_path_by_url ancestor map are optional hints kept for older files:

data/docs_nav.json
{
  "sections": [
    {
      "page": "/docs/start",
      "url": "/docs/start/",
      "children": [{ "page": "/docs/start/install", "url": "/docs/start/install/" }]
    }
  ],
  "active_path_by_url": {
    "/docs/start/install/": ["/docs/start/"]
  }
}

Write paths without a language prefix and without the deployment subpath from baseURL. The theme strips both before comparing, so /docs/start/ matches /zh/docs/start/ and /handbook/zh/docs/start/, and rendered links keep the real prefixes.

The tree can also group pages without moving their files. With docs_section: docs and docs_sidebar_root: section, root-level pages of type docs can be arranged like this:

data/docs_nav.json
{
  "sections": [
    { "page": "/intro" },
    { "page": "/config", "children": [{ "page": "/api" }] }
  ]
}

content/config.md and content/api.md stay sibling files, but API appears under Config, and opening API expands Config. A node applies to a sidebar root when it is that root, sits below it in content/, or is a Docs or Book page that resolves to the same root. A custom page URL changes the link, not where the page sits in the sidebar. A separate Book root, or a root nested with sidebar_root_for, uses its own branch, and a root missing from the file keeps its folder tree.

The same tree drives the previous/next links and the navigation JSON, so the pager and the sidebar always agree. An empty sections array warns and falls back to the folder tree, and a page that does not exist warns and is skipped. Placeholder nodes with manual_link and sidebar_divider rows stay in the sidebar without becoming paging targets. A divider section keeps its children here too; use the same group-only front matter as in the folder tree.

Sidebar icon density

A page’s icon front matter shows in the sidebar. An icon on every leaf makes a long tree harder to scan, so you can limit them:

hugo.yml
params:
  ui:
    sidebar_icon_policy: groups # all | groups | none
Value Effect
all (default) Every entry with an icon shows it
groups Only the root and entries with children show icons
none No entry icons in the sidebar

An invalid value warns and uses all. This site uses groups.

Expanding headings in the sidebar

On a long Book chapter, readers can jump between sections from the sidebar when the current page’s h2–h4 headings appear as a branch under its row. The branch is off by default; turn it on with:

hugo.yml
params:
  ui:
    sidebar_headings: 3 # false | true | 2 | 3 | 4

An integer from 2 to 4 is the deepest level shown, true means 2 (h2 only), and false turns the branch off; any other value warns and turns it off. It applies only to type: book pages and only under the current page’s row, and the outline on the right stays. Front matter or a section cascade can set the same key, and sidebar_headings: false turns off an inherited setting.

Table of contents

The outline on the right lists the page’s Markdown headings. Which levels it collects is Hugo’s own setting:

hugo.yml
markup:
  tableOfContents:
    startLevel: 2
    endLevel: 4
    ordered: false

The outline always follows the reader: a continuous rail marks the current section as the page scrolls, with no setting to turn on. Readers can collapse the right column, and the browser remembers it. Below the xl breakpoint the column hides and the outline moves into the sidebar drawer. An older configuration may still set params.ui.scroll_spy or a page-level scroll_spy; both are accepted and ignored.

To hide the outline on one page, set notoc: true in its front matter.

Only headings that reach Hugo’s table of contents appear. Headings produced by Markdown-style shortcodes ({{%/* … */%}}) do; headings inside ordinary shortcodes ({{</* … */>}}) usually do not, so write structural headings in Markdown.

Section index style

A section with an _index.md lists its child pages automatically, either as a list or as cards:

hugo.yml
params:
  ui:
    section_index: cards # list | cards
    section_index_columns: 2
  • list (default): each child’s title, then its description.
  • cards: a grid of cards showing each child’s title (or linkTitle), description and icon; section_index_columns (default 2) sets the columns.

A section can choose its own style in its front matter. An invalid value warns and uses the default:

content/docs/components/_index.md
---
title: Components
section_index: cards
section_index_columns: 3
---

no_list: true lists no children, simple_list: true lists them as plain bullets without descriptions, and a child with hide_summary: true leaves itself out. Let the theme build these lists rather than writing them by hand, because a hand-written list drifts out of step with the sidebar.

Page width

hugo.yml
params:
  page_width: normal # normal | wide | full

normal is a comfortable reading width, wide widens the content column and full fills the window. Set it per page or, through a cascade, per section; wide tables, large images and API references often need wide:

content/docs/api/reference.md
---
title: API reference
page_width: wide
---

Book pages also accept reading_width (slim, normal or wide), which changes the measure of the text without changing the shell. An invalid value for either key warns and uses normal.

Navbar and footer switches

The navbar and footer can be switched per page with top-level front matter keys, not keys under ui. To change a whole section, set them once in its cascade:

content/docs/_index.md
---
title: Docs
cascade:
  navbar_enabled: false
  footer_style: slim
---

What each key does is described in Navigation and menus and Brand and appearance; the full list of keys is in Page parameters.

Verify

hugo --printPathWarnings
  • The build ends with Total in … and reports no ERROR.
  • A new type: docs page has the left sidebar. If not, check that the cascade reaches it and that its type is in shell_types.
  • Dragging the sidebar divider and reloading keeps the width; double-clicking restores the default.
  • Below md the sidebar is a drawer you can close, and below xl the outline sits in that drawer.
  • A section index shows as many entries as the sidebar has child pages.
  • A page with page_width: wide is wider than its neighbors.
  • With documentation at the site root, the build reports no duplicate output paths.

6 - Search

Add full-text search that runs in the reader’s browser, and control what it indexes and how it ranks results.

OINK’s search runs entirely in the reader’s browser. Hugo writes one JSON index per language at build time, the browser downloads it on the first search, and every query is answered locally, so there is no crawler, account, CDN or search service to set up, and queries never leave the page. Search is off by default; one line turns it on.

Readers search from the command palette; Command palette covers how they open it and what else it offers.

Turning on local search

hugo.yml
params:
  offline_search: true

Search then appears on the home page, on every page with a shell layout (docs, book, blog, swagger or expo; see Layouts and page types), and on landing pages while params.ui.landing_search is on. Print output never carries it. Other pages get no search dialog, index reference or engine at all: these are not hidden, they are never generated.

hugo server builds the index too, so the preview searches exactly like production. On a very large site, rebuilding the whole index slows every preview noticeably, and you can skip it during preview:

hugo.yml
params:
  offline_search: true
  # skip index building during preview; only needed on very large sites
  offline_search_on_serve: false

Controlling index size

offline_search_index decides how much of each page goes into the index. That is a trade between what readers can find and how much their browser downloads on the first search:

hugo.yml
params:
  offline_search: true
  offline_search_index: summary
  offline_search_summary_length: 70
  offline_search_max_results: 10
Value What is indexed When to use it
title Title, tags, categories, search_keywords A very large site where titles alone locate a page
heading The above plus every heading in the page When headings are specific enough
summary The above plus description and summary Sites with thousands of pages. This site uses it
content The above plus the full plain text The default, suitable up to a few hundred pages

offline_search_summary_length sets the length, in characters, of the excerpt stored for each page (default 70), which a result shows when no passage matches. offline_search_max_results caps the page results of one search (default 10). Configuration has the full definitions.

A large content index does not delay the first search. While a language’s index stays within 2 MiB, it is published as one file. Above that, the build moves page text into a second file, offline-search-body.<lang>.json, so the first download holds only titles, headings, field entries, descriptions and keywords, and the palette answers from those at once. It then fetches the page text in the background when that file is 8 MiB or smaller, or waits for the reader to choose Search page text when it is larger or the browser asks to save data (Save-Data). To leave page text out altogether, use summary.

Adjusting ranking

A page can help readers find it through its own front matter:

content/docs/reference/pgsql.md
---
title: PostgreSQL parameters
search_keywords: [postgres, postgresql, pg, database parameters, GUC]
search_boost: 1.5
---

search_keywords adds the words readers type that the page itself may never use, as a string or a list. It usually helps more than a boost: a reader who types pg or GUC now finds a page titled only “PostgreSQL parameters”. Keywords rank just below the title and above the body.

search_boost multiplies a page’s score, both its field strength and its section BM25 score, and defaults to 1.0. A value of 1.5 lifts a page without ever letting a partial match beat a complete one. Zero, negative and non-numeric values warn and count as 1.0.

Set a default for a whole section once with a cascade; a page’s own value still wins over the inherited one:

content/docs/_index.md
---
title: Docs
cascade:
  search_boost: 1.25
---

On this site, every page under docs/ lists its Chinese phrasing, its English terms and the configuration keys it documents in search_keywords.

Keeping a page out of the index

content/internal/draft-plan.md
---
title: Internal plan
search_exclude: true
---

The index also leaves out pages with an empty body. Only search_exclude works: the retired exclude_search and excludeSearch keys are ignored, so a page that still uses them stays searchable; the migration checker reports them.

The index is a static JSON file anyone can download; it is not access control.

Do not put content that should stay private on the site, and do not use search_exclude to protect it.

Chinese, mixed queries, and identifiers

The engine scores the downloaded index with BM25 as it scans it, and builds no index of its own in the browser. It splits text by each character’s Unicode script rather than by the page’s language, so one query can mix English, Chinese and code identifiers:

  • Unspaced CJK queries. Runs of Chinese, Japanese and Korean match through overlapping character pairs, with no dictionary, so 数据库连接池超时 or PostgreSQL备份 works without spaces. A single CJK character stays one term, and a boundary between CJK and Latin text splits automatically. search_keywords is still the place for synonyms and abbreviations.
  • Identifiers and symbol runs. Names with underscores, hyphens or dots, paths, command options and runs of two or more symbols (shared_buffers, pg_basebackup, --baseURL, /pg/data, ->>) match literally and are never spelling-corrected.
  • Word boundaries, stemming and typos. Ordinary words match whole words exactly, so port does not match support. Loose matches count for 0.7 of the field’s weight: the prefix of a longer word, a Porter inflection of an ASCII word, a four-character stem in other alphabets, a word of five or more characters inside an underscore name or compound, and a spelling correction. Spelling correction applies only to ASCII words of five or more characters that appear in no form in the selected scope: one edit for 5–7 characters, two from 8, with a swap of adjacent letters counting as one.
  • Query terms and stop words. Case and Unicode width are normalized, and up to 30 terms of a query take part. A short list of English function words and six Chinese question words (为什么, 如何, 怎么, 怎样, 什么, 请问) score at 0.1 and are not required, unless the query consists of nothing else.

The terms of a query may match in different fields of a page. Results rank by these rules, in order:

  1. A page that covers at least 90% of the query’s weight is a complete match, and complete matches hide partial ones. When there is none, partial matches appear in descending tenths of coverage, labelled with how many terms matched.
  2. Among complete matches, a page whose match fits in one section (plus page-level fields) comes before one whose match spans several sections.
  3. Field strength is the weighted mean of each term’s strongest field (title 10, keywords 8, tags and categories 6, headings and search entries 5, description 3, body 1; loose matches × 0.7), multiplied by 1.5 when the terms appear adjacent and in order, and then by search_boost.
  4. Equal strength is broken by the best section’s BM25 score (k1 = 1.2, b = 0.5) times search_boost, and after that by title and URL.

A boost cannot lift a partial match above a complete one. Results stay grouped by content root in the navbar’s order; the result limit applies first, and the ranking orders each group. A page found only through its keywords shows its description or excerpt, never the keyword list.

Each page takes one result row, however many of its sections match. The row names the best matching section or entry, shows up to 160 characters around the hits with inflections and corrections highlighted as the page spells them, and opens the rendered anchor. Every anchored field, whether from {.fields} or fields/field, carries data-td-search-entry automatically, so searching for a parameter name jumps straight to its definition; your own markup with an id and a non-empty data-td-search-entry works the same way. A match only in page metadata opens the page itself. The heading and summary scopes can still land on headings and field entries, but words that appear only in body text need content.

The palette’s Search in control narrows results to the current top-level section (the home page has none); Command palette describes it. While an input method is composing, results and Enter wait until the text is committed. Empty, loading, unavailable, result-count and partial-match states all have readable text and are announced to screen readers.

Optional: hosted search

The theme also integrates two hosted search services, both off by default. Each sends every query to a third party, so if you enable one, describe its crawling, availability and privacy terms in the site’s privacy statement. A site uses one search backend: when more than one of local search, Algolia and Google is configured, the build warns params: more than one site-search backend is configured.

Algolia DocSearch

hugo.yml
params:
  search:
    algolia:
      appId: YOUR_APP_ID
      apiKey: YOUR_SEARCH_ONLY_KEY
      indexName: YOUR_INDEX

All three values are required, and OINK never falls back to another project’s public index. DocSearch’s script and styles ship with the theme, so nothing loads from a CDN, but every query goes to Algolia. It needs real credentials and an index, so this page shows no live demo.

Google Programmable Search

hugo.yml
params:
  gcs_engine_id: YOUR_ENGINE_ID

Results also need a page of their own:

content/search.md
---
title: Search results
layout: search
---

The search box submits to <baseURL>/search/?q=…, where Google’s script renders the results; the reader’s browser must be able to reach cse.google.com. Because it depends on that service, this page shows no live demo.

Verify

  1. Build, and confirm there is one index per language:

    hugo --printPathWarnings
    ls public/offline-search-index.*

    A development build names the file offline-search-index.zh.json; a production build adds a fingerprint, as in offline-search-index.zh.7ab….json. A missing file means that language’s pages never reached an index.

  2. When Chinese queries find nothing, inspect the index first:

    python3 -c "import glob,json; f=sorted(glob.glob('public/offline-search-index.zh*.json'))[0]; \
      d=json.load(open(f)); print(f, len(d)); print(d[0])"

    The entry count should be close to the number of Chinese pages, and the keywords and boost fields should show what the front matter set.

  3. Open the site and press /. Search for an English word, then a Chinese one. Results are grouped by content root, each group named after the first breadcrumb segment.

  4. For a subpath deployment such as https://example.com/docs/, open the browser’s network panel and check that the index request includes the subpath. An index request to the domain root returns 404 while the page itself works, and this is the most common reason search returns nothing.

  • Command palette — search’s entry point, and the commands and page actions beside it
  • Keyboard navigation — the four single keys that open search and commands
  • Languages — per-language indexes and untranslated fallback
  • Configuration — full definitions of the offline_search* keys
  • Page parameters — search_keywords / search_boost / search_exclude

7 - Command palette

Use one dialog for page search, page actions, and site commands. Open the palette, use its groups, and add custom commands.

The command palette provides one modal dialog for page search and site actions. Use it to copy page Markdown, switch language or version, and open site links. The theme assembles it with local search. If params.offline_search is off, the page has no palette, index, or search engine. See Search.

Opening the palette

How to open it What opens
Click the search box in the navbar or sidebar Full search mode
⌘ / Ctrl + K Full search mode. Press again to close
/ Full search mode
\ Command-only mode (equivalent to a prefilled >)
f / c The same two, provided by keyboard navigation
Typing a query beginning with > in the box Command-only mode

On layouts where \ is hard to reach, use c or type > instead.

/, \, f, and c are bare single keys. They do not open the palette during typing. This applies to focus in an input, textarea, select, or contenteditable, and to input-method composition. The keys type ordinary characters instead. The modified ⌘/Ctrl + K can open the palette from a text box. It also remains inactive during input-method composition. Another open native dialog or visible ARIA dialog blocks every opening shortcut, including fixed-position dialogs. Hidden ARIA dialogs do not block them.

Inside the palette, use ↑ ↓ to select an item. Press Enter to run it. Press Esc to close the palette and return focus to the opening control.

What the palette holds

With nothing typed, the palette lists four groups in a fixed order:

Quick links1

A few entry points chosen from the navbar’s top-level menu.

Decided by: params.ui.quick_links.

Page actions2

Copy Markdown, Open in ChatGPT / Claude, view Markdown source, view history, edit this page, create a child page, create docs/project issue, print the section, open the duo view (compare_translations).

Decided by: repository configuration, assistant_links, whether this page has a Markdown output, and for the duo view params.ui.compare plus a same-origin translation.

Preferences3

Switch version → switch language → switch style → switch theme.

Decided by: whether the site configures versions, languages, the preset menu (preset_menu), and the light/dark menu.

Commands4

Copy link (copy_link), open the GitHub repository, open the browsing history, then the site’s own commands.

Decided by: always available for copy_link, params.github_project_repo (falling back to github_repo), whether keyboard navigation is on, and ui.command_palette.commands.

The four preferences follow the navbar order: version, language, style, theme. Selecting a preference such as “switch language” does not navigate immediately. The palette expands its options in place. Select an option in a second action.

When you type text, page results appear first, grouped by content root. Each group uses the first breadcrumb segment as its name. Groups follow the navbar’s top-level menu order. Commands and actions appear together in the final group.

A query starting with > lists commands and actions only and searches no pages. Use it when you are unsure which menu holds a feature.

If the theme can explain why an item is unavailable, the item remains listed. Without repository configuration, “edit this page” remains with an “unavailable” note.

The palette also offers two adjacent Search in options for all sections or the current top-level section. It filters page results before the result limit, while commands and page actions remain available. The choice persists only while this page stays loaded. Matching sections appear beside page titles and open real heading anchors; multiple hits on one page share one row. Partial matches show their term coverage. See query semantics. Tab focuses the selected scope; arrow keys switch it. The control disappears in command and preference-choice modes.

Select quick links from Hugo’s main menu by identifier. You do not need to define them again:

hugo.yml
params:
  ui:
    quick_links: [docs, blog]

Values use the identifier of entries in menus.main. If unset, the list defaults to the documentation and blog sections (params.ui.docs_section and blog_section). To configure the menu, see Navigation and menus.

Custom commands

A site’s own commands go under params.ui.command_palette.commands, after the built-in ones, in the order written:

hugo.yml
params:
  ui:
    command_palette:
      commands:
        - id: theme_issues
          title: OINK issues
          description: Report or browse theme and documentation issues
          url: https://github.com/pgsty/oink/issues
          icon: fa-brands fa-github
          keywords: [bug, support, roadmap]

This site uses the command above. Commands have seven fields. An unsupported key or invalid record warns and discards that command:

  • id is required. It must start with a lowercase letter and contain only lowercase letters, digits, underscores, and hyphens. It must not duplicate a built-in action ID.
  • title supplies the displayed title. The description supplies the smaller line below it. The icon is one Font Awesome class pair.
  • keywords is an array of possible reader search terms. It participates in matching but is not displayed.
  • url and action are mutually exclusive and one is required. The url accepts a full http/https address, site path, or in-page anchor beginning with #. An address with a host opens in a new tab. The action references a built-in action ID.
Do not alias a built-in action with action:

Built-in actions are already in the palette, and wrapping one makes the same feature appear twice under two names.

For a multilingual site, put commands under languages.<lang>.params.ui.command_palette.commands. This lets you localize titles and keywords. The default language’s list sets the order. An entry with the same id in another language overrides only fields. A new id is appended. Command order therefore remains the same across languages.

Configuration can supply only a link or built-in action reference. It cannot inject a JavaScript callback. The palette reads a plain data manifest.

Page actions

The palette’s “page actions” and the documentation title’s split button share one implementation. They use the same action descriptors, URL generation, and executor. The button’s left half copies the page’s Markdown. Its right arrow expands all actions.

To hide the button beside the title, set page_context_menu: false. The corresponding actions stay in the palette:

hugo.yml
params:
  ui:
    page_context_menu: false

To hide the button on just one page, use page_context_menu: false in that page’s front matter instead.

The assistant_links setting is off by default. Clicking an assistant link sends the current page’s full URL, including query string and anchor, to a third party. It never uploads the body. Enable links site-wide through params.ui.page_context_menu.assistant_links. A page can only restrict that policy with this front matter:

Page front matter
page_context_menu:
  assistant_links: false

Check the title menu and palette. Neither should offer assistant links on that page. See AI-agent support for handoff behavior.

The links open ChatGPT and Claude.

links adds external actions that appear only in the menu beside the title, not in the palette:

hugo.yml
params:
  ui:
    page_context_menu:
      links:
        - name: Ask in Discussions
          url: https://github.com/pgsty/oink/discussions/new?title={title}
          icon: fa-solid fa-comments

The three placeholders {url}, {title} and {markdown_url} are replaced with the current page’s values.

Whether “edit this page”, “view history” and “open an issue” are available depends on repository configuration. See Repository links and page info. “Copy Markdown” and “view Markdown source” require the page’s markdown output. See AI-agent support.

The dialog uses two independent data sources:

  • Page results come from the local search index. If the index was not generated or fails to download, the palette still opens and runs commands. The page section reads “the page index is unavailable; actions still work”.
  • Commands and actions come from a JSON manifest embedded in the page and need no network.

The theme does not assemble the palette for print output. If offline_search is off, there is also no palette. The keys f and c then do nothing and do not affect normal typing.

Query-aware site actions

Trusted site JavaScript can register query-aware tail rows through window.OinkCommandPalette.registerSearchTail. Feature-detect the hook before calling it, because pages without local search do not provide it. Load the integration after the theme scripts, for example through layouts/_partials/hooks/body-end.html. This example assumes the site implements openSiteAssistant and owns its provider settings:

if (window.OinkCommandPalette?.registerSearchTail) {
  const unregister = window.OinkCommandPalette.registerSearchTail({
    id: 'ask-site',
    rows(context) {
      return [{ id: 'ask', title: 'Ask the site', description: context.query }];
    },
    activate(row, context) {
      context.handoff();
      return openSiteAssistant(context.query, {
        locale: context.locale,
        signal: context.signal,
      });
    },
  });
  // Call unregister() when removing this integration.
}

Rows follow native results and actions, including empty/error searches. They are absent in empty, command, choice, and loading states. Keep rows() pure and synchronous. All strings render as text. Activation receives the query that created the row, not newer input. Before opening another coordinated surface, use handoff(). The site then owns its focus and failure UI. For non-UI actions, return the operation without calling handoff.

The Shell contract defines fields, cancellation, validation, and lifecycle. YAML cannot contain callbacks. OINK adds no remote service or telemetry by default.

Verify

Run from your site’s root after a production build. In the commands below, replace public/docs/getting-started/index.html with an actual generated documentation page in your site (including a language prefix if needed).

  1. After a build, confirm the command manifest reached the page:

    hugo --printPathWarnings
    PAGE=public/docs/getting-started/index.html
    test -f "$PAGE" && grep -o 'td-action-manifest' "$PAGE"

    This confirms that HTML contains the action data. The remaining steps check the palette interface with local search enabled.

  2. Open the site. Press ⌘/Ctrl + K without typing. Confirm this order: quick links, page actions, preferences, commands.

  3. Type >. Confirm that only commands and actions remain. A new command should appear after “open the GitHub repository”.

  4. Repeat step 3 in another language. Confirm that command titles change and order remains the same.

  5. Open print preview (⌘/Ctrl + P). Confirm that it contains no palette.

8 - Keyboard navigation

Use single-key shortcuts and understand when typing disables them. Disable shortcuts for the site or individual pages.

Your readers can work through your documentation without reaching for the mouse: every interactive OINK page answers twenty-nine single-key shortcuts, ten for moving around, nine for acting on the page and ten for changing the view. Press ' on any page to see all twenty-nine; keys the current page cannot use are dimmed. Shortcuts are on by default, step aside whenever the reader is typing, and can be turned off for a site or a page.

Navigation

Key Action
W S Move to the previous / next entry of the sidebar tree
A D Collapse / expand the section
Enter Space Open the focused tree entry
Q E Previous / next page in sidebar order
K J Previous / next heading of the page outline
X Switch to the next language
R Switch to the next top-level section
V Switch to the next version
H Open the browsing history
G Go to the home page

Sidebar tree

The tree keys work on every page with a sidebar tree, and you do not have to enter the tree first: with focus in the article, S moves from the current page’s entry to the next one in a single press. The focused row is tinted one step darker than the current-page row, so “where I am” and “where the cursor is” stay distinguishable. When the sidebar sits in the phone drawer or is collapsed on desktop, the first press opens it.

Once focus is in the tree, ↑ ↓ ← → work like the letters; in the article the arrows keep native scrolling. In a right-to-left language ← and → follow the reading direction, while A always collapses and D always expands.

From a page entry, A first moves to the parent section and a second press collapses it. D opens a collapsed section, or steps into its first visible child when it is already open. Sections without a page of their own take focus through their disclosure button, which Enter or Space toggles. Esc leaves the tree and returns focus to where it was.

Reading

K and J visit the same targets as the right-hand outline and land where an outline click would. Every jump takes 100 ms however far it goes, and you can press again before it finishes. Deep inside a section, K first returns to that section’s start. A page without headings scrolls a short step instead. On the home page the two keys move between the landing sections.

Q and E follow the order the sidebar shows, not dates, and skip collapsed branches, so paging and tree focus always agree. A section’s index page is an entry of its own: at a blog boundary the order runs from the last post of one section to the next section’s index, then to its first post. Without a sidebar tree, paging uses the page-end pager, then the rel="prev" and rel="next" links in <head>.

Language, section and version

These keys work on every interactive page and do nothing when there is no other choice:

  • X switches to the next language, wrapping after the last one. It opens this page’s translation, or that language’s home page when the page has none.
  • R cycles through the same-origin top-level navbar entries. It skips external links and the navbar’s utility controls.
  • V opens the next version listed in params.versions that has a URL, wrapping after the last one.

Browsing history

H opens a search-style list of the pages you have read on this site, newest first. The page you are on is left out, so H then Enter takes you back to the previous page.

Key In the history list
Typing Filter by title and path; every word must match
↑ ↓ Select an entry
Enter Open it; Ctrl with Enter (⌘ with Enter on macOS) opens it in a new tab
Shift with Delete Remove the selected entry
Esc Close the list

Clear history removes all stored visits, including the current page. The command palette also offers a Browsing history command that opens the same list.

History keeps the last 100 pages in this browser’s localStorage, under a key named after the site’s base path, such as td-history:/. Every language of the site shares one list, and two sites on the same domain keep separate ones. OINK never sends it anywhere. It is recorded only on pages where keyboard navigation is on, and there is no separate switch for it.

G opens the home page of the current language. On the home page itself it scrolls back to the top.

Actions

Key Action
/ F Search
\ C Open the command palette with commands only
U Edit this page
N Create a child page
I Create a docs issue
O Expand or collapse everything that folds
P Print this page
[ Open in ChatGPT
] Open in Claude

/ opens the command palette ready to search, and \ opens it with commands only. Both keys belong to the palette, so they keep working when keyboard navigation is off; F and C are the keyboard navigation equivalents. ⌘ with K on macOS and Ctrl with K elsewhere open the palette from anywhere, even a text field, and close it again. On layouts where \ is hard to reach, press C or type > at the start of the search box.

The palette needs local search (params.offline_search: true); without it these four keys do nothing.

Page actions

U, N and I run the same actions as the page menu beside the title and open their target in a new tab. All three need a repository configured for the site; U and N also need a page with a source file, so they do nothing on generated pages such as tag lists. P prints the page, exactly like the browser’s print command.

[ and ] hand the page to ChatGPT or Claude in a new tab. They work only when the site enables params.ui.page_context_menu.assistant_links.

Expand or collapse all

O opens everything on the page that folds: the sidebar sections, the right-rail groups (outline, backlinks, term clouds), collapsible callouts, file trees, “show more” lists and long code blocks. When everything is already open, it folds all of them instead, except the sidebar branch of the current page, so you never lose your place. The line you are reading stays where it is while the page above it grows or shrinks.

Menus and popovers such as navbar dropdowns are not folded content and stay closed. Collapsed rails stay collapsed; restore them with their own buttons.

View

Key Action
B Open or close the Duo View
Z Turn Zen Mode on or off
M View the page’s Markdown source
T Switch to the next visual style
Y Switch color mode: light, dark, system
L Switch the index layout: list, cards, table, gallery
; Switch the gallery layout: wall, cards, seamless
, . Smaller / larger gallery images
- = Narrower / wider reading column
' Open or close the shortcut help

Zen Mode and Duo View

Z hides the navigation shell so only the text remains: the navbar and footer on the home page, and also both rails and the floating buttons on documentation pages. The choice lasts for the browser tab and is restored before the first frame, so paging with Q E keeps it without a flicker. At phone width the top bar stays, because it is the only way back to the navigation. While the shell is hidden, the tree keys do nothing.

B opens the Duo View when the site sets params.ui.compare: true and the page has a translation, and closes it again from either pane.

M opens the page’s Markdown output in a new tab on sites that publish it.

Appearance

T steps through the visual styles the site offers in params.ui.preset_menu and wraps after the last one; it does nothing when the site offers a single style. Y steps through light, dark and system color modes and does nothing when the dark palette is off (params.ui.dark_mode disabled). Both work on every interactive page and remember the choice like the Appearance menu does.

Index and gallery layouts

On blog, release and case index pages with params.ui.blog_index_toggle, L cycles the index through list, cards, table and gallery. On an Expo album, and on an index while its gallery view is showing, three more keys control the grid:

Key Gallery action
; Cycle the layout: wall, cards, seamless
, or < Shrink the target image size by 20 px, down to 160 px
. or > Enlarge the target image size by 20 px, up to 360 px

The toolbar follows each change, the grid reflows at once, and the choice is remembered: td-expo-mode and td-expo-size for Expo albums, td-blog-gallery-mode and td-blog-gallery-size for index galleries. Clicking a layout icon or dragging the size slider does not stop these keys.

Page width

On wide screens the reading column keeps its page width even when the window has room to spare. - and = (or +) narrow and widen it by 100 px at a time on documentation, book, blog and Expo pages:

  • The column never gets narrower than 600 px and never wider than the space between the rails. Widening until it touches the rails makes it fill that space on any screen size.
  • The width applies to every page of the site in this browser and is restored before the first frame. It replaces each page’s page_width and the Book content measure. Printing ignores it.
  • A step that reaches the page’s own width stops there and forgets the stored width (td-shell-article-w in localStorage), so stepping back always returns every page to the width its author chose.

Expo viewer

An Expo image opens in a viewer with its own keys for moving, zooming and changing images, listed in the Expo guide. Page shortcuts pause while the viewer is open and resume when it closes. The viewer keys work even when keyboard_nav is off.

Shortcut help

' opens all twenty-nine shortcuts in a centered dialog: navigation, actions and view side by side (ten, nine and ten rows). Rows the current page cannot run stay in place but are dimmed, and screen readers hear them as unavailable, so the grid keeps the same shape everywhere. The dialog opens from anywhere: in the middle of a long page, in Zen Mode, or on pages without a footer (footer_style: none). ', Esc, the close button or a click outside the dialog closes it.

The question-mark button at the end of the footer’s bottom bar offers the same sheet. Hovering or focusing it previews all twenty-nine shortcuts directly above the footer (three columns side by side on wide screens, wrapping cleanly on narrower screens), with unavailable rows already dimmed; clicking it opens the centered modal dialog with the Enable shortcuts toggle, and closing the dialog returns focus to the button.

With keyboard navigation off and local search on, the button keeps only the two palette keys, / and \, and opens no dialog.

Keys left free

? and the digits are deliberately unbound, and modified letters keep their usual meaning except for the exact search chord Ctrl with K or ⌘ with K. Use the character printed by your keyboard layout. For example, German Shift with 7 opens search. The gallery and width keys also accept Shift to produce ,, ., ;, <, >, = or +.

When shortcuts stand down

Every binding is a single key, so each one steps aside when it could collide with typing or an overlay:

  • Focus is in a text field: <textarea>, <select>, contenteditable, or an <input> you type into, such as text, search, email, password or number. Non-text controls such as gallery layout radio buttons and the size slider keep the page shortcuts and their own arrow keys.
  • Focus is inside a map or an audio or video player, which keeps its own keys.
  • An input method is composing, which matters on every Chinese, Japanese or Korean site.
  • A modifier key is held. ⌘ with C still copies, Shift with M does nothing, and Shift with ↓ stays a browser action.
  • The command palette, the browsing history, the shortcut help, the Expo viewer, another open dialog or a visible ARIA dialog owns the keyboard. Hidden ARIA dialogs do not block shortcuts.

Comments load in an iframe, so their keystrokes never reach the page.

Focus order and accessibility

  • Skip link: the first Tab on a page reveals “Skip to content”, which passes the navbar and sidebar in one step and marks the article title.
  • Real focus: tree navigation moves the actual DOM focus, so a screen reader announces the link name and its “current page” state, Enter keeps the link’s native behavior, and the Tab order is unchanged.
  • Hidden content: a collapsed sidebar or closed drawer leaves the Tab order, while the button that restores it stays reachable. Clicking the article, a table or a code block does not leave a large outline behind for the next key.
  • High contrast: under forced-colors the focused row and the selected history entry are outlined in the system highlight color.
  • Reduced motion: with prefers-reduced-motion, heading jumps and paging land instantly.
  • The keycaps in the shortcut help are the same as the Kbd component you write in pages.

Turning it off

To turn off single-key shortcuts for yourself, open shortcut help and uncheck Enable shortcuts (enabled by default). At the start of any page with these shortcuts, Tab past Skip to content to reach the same checkbox. This also works on pages without a footer. Space toggles the checkbox. Your choice applies across the site’s languages in this browser. Ctrl+K or ⌘K still opens the search palette.

Site-wide:

hugo.yml
params:
  ui:
    keyboard_nav: false

For one page, such as an interaction-heavy demonstration, or for a whole section through cascade:

content/docs/playground.md
---
title: Interactive playground
keyboard_nav: false
---

The key takes a boolean only; see Configuration for the complete definition. A page with keyboard navigation off ships no keyboard runtime at all: no shortcuts, no browsing history recording and no restored page width. /, \ and ⌘ with K belong to search and keep working, and the footer’s collapse arrow is unaffected.

Verify

Build your site, then replace public/docs/getting-started/index.html below with a documentation page your site actually generates, including any language prefix.

  1. Confirm that the help button is in the page:

    hugo --printPathWarnings
    PAGE=public/docs/getting-started/index.html
    test -f "$PAGE" && grep -c 'td-shell-keyboard__trigger' "$PAGE"

    With keyboard navigation off and no local search, the button is not generated.

  2. Open a documentation page and press ': three columns appear, with dimmed rows for features this page lacks. Press it again to close the dialog.

  3. With focus in the article, press S a few times. The sidebar focus moves down from the current page and the article stays still. Then press E and check that pages follow the sidebar order.

  4. Read two pages, then press H and Enter: you are back on the first one.

  5. Press O twice. Every sidebar section opens, then everything folds again except the branch of the current page.

  6. On a wide window, press = and -. The column widens and narrows, and keeps its width after a reload.

  7. Click in the search box and press J. The letter is typed and the page does not scroll. Repeat with an input method.

9 - Languages

Add a second language end to end, keep heading anchors aligned across translations, and let readers compare two languages side by side.

OINK uses Hugo’s multilingual model as it is: a languages block in hugo.yml, and each translation saved beside its original with a language suffix. Adding a language touches five places: the configuration, the translated pages, the menus, the home page data and, only if you want to reword them, the theme’s interface strings. The language picker, hreflang links and per-language search follow from those without further setup.

Enable a second language

hugo.yml
defaultContentLanguage: en

languages:
  en:
    label: English
    locale: en-US
    weight: 1
    title: Acme DB Docs
    params:
      description: Documentation for the Acme DB time-series database
  zh:
    label: 简体中文
    locale: zh-CN
    weight: 2
    title: Acme DB 文档
    params:
      description: Acme DB 时序数据库文档
      time_format_default: 2006年1月2日
      time_format_blog: 2006年1月2日
  • label is the name in the language picker, written in that language: 简体中文, not Chinese.
  • locale is the standard language tag used for <html lang>, the hreflang alternate links and Open Graph metadata.
  • weight orders the languages, lowest first, in the picker and in its one-click cycle.
  • params overrides site parameters for this language; any key not set here keeps the global value. Date formats usually need a per-language value.

The default language is served without a path prefix (English at /docs/…) and every other language under its own (Chinese at /zh/docs/…). To prefix the default language too, add defaultContentLanguageInSubdir: true; on a live site this changes every URL, so set up redirects at the same time.

Translate the pages

Save each translation beside its original with the language code before the extension. Hugo pairs files that share a base name, so these are one page in two languages:

  • content/docs/
    • install.mdEnglish
    • install.zh.mdChinese
    • _index.md
    • _index.zh.md

Page bundles work the same way, with index.md and index.zh.md in one directory. Inside a bundle, a resource without a language suffix is shared by every language and a suffixed one belongs to that language only. Reference a suffixed resource without its suffix, ![Screenshot](screenshot.webp), and Hugo picks the file for the current language:

  • content/docs/install/
    • index.mdEnglish page
    • index.zh.mdChinese page
    • topology.webpused by both languages
    • screenshot.zh.webpused by the Chinese page only

A bundle that has only index.zh.md needs the .zh. suffix on every resource. Unsuffixed resources belong to the default language, which has no page in that bundle, so the Chinese page would not see them.

Translate what readers see and keep what Hugo uses for structure identical:

  • Translate: title, description, summaries, menu labels, tag names, image alt text, callout bodies and reader-facing shortcode parameters.
  • Keep identical: dates, weight, aliases and anything else that affects routing or order; a different weight puts the page in a different sidebar position in each language.
  • Leave untranslated: commands, configuration keys, file names, URLs, version numbers, product names and shortcode names.

Menus, home page and interface strings

Three things live outside content/ and need one copy per language.

Menus are written under each language:

hugo.yml
languages:
  zh:
    menus:
      main:
        - identifier: docs
          name: 文档
          pageRef: /docs
          weight: 20

Use the same identifier in every language, because the command palette’s quick links and the grouping of search results are matched by it. The full menu syntax is in Navigation and menus.

Home page data is one file per language, data/home/en.yaml and data/home/zh.yaml; a language without a file falls back to en.yaml. See Home and landing pages.

Interface strings, such as the search placeholder and the page-action labels, are already translated: the theme ships complete, native catalogs for 32 locales (ar, az, bg, bn, de, en, es, et, fa, fi, fr, he, hi, hu, it, ja, ko, nl, no, oc, pl, pt-br, ro, ru, sr-cyrl, sr-latn, sv, tr, uk, zh, zh-cn and zh-tw). zh and zh-cn are Simplified Chinese and zh-tw Traditional. To reword a string, create a file of the same name in the site’s own i18n/ with only the keys you change; key names are in the theme’s i18n/en.yaml, and any placeholder such as {{ .Count }} in the original must stay in your version.

i18n/en.yaml
ui_search: Search the docs

Align heading anchors

Hugo derives a heading’s ID from its text, so a translated heading gets a different ID: /docs/install/#prerequisites and /zh/docs/install/#前置条件 are the same section under two anchors. A deep link copied from one language then fails in the other, every cross-reference has to be written twice, and Duo View cannot keep its two panes at the same section. Give the translated heading the original’s ID explicitly:

install.zh.md
## 前置条件 {#prerequisites}

Take the ID from the English page’s rendered HTML rather than guessing it from the heading text, because inline code, badges and shortcodes in a heading change the generated ID. Keep the same headings, in the same order, with the same IDs on both sides; a section that exists in only one language gets its own stable ID that does not collide with the other’s. Adding {#id} when you write a page costs far less than retrofitting it.

To compare one translated pair after a build:

ids() { grep -oE '<h[2-6][^>]* id="?[^" >]+' "$1" | sed -E 's/.*id="?//'; }
diff <(ids public/docs/install/index.html) <(ids public/zh/docs/install/index.html)

To check every pair in CI, the OINK documentation site runs check-doc-translations.mjs, which compares source structure and rendered heading IDs. It is written for that repository’s content sections and EN/ZH file names, so adapt both before running it on another site.

Missing translations and the language picker

The language picker’s icon is itself a link to the next language by weight, wrapping round after the last, so a bilingual site switches with one click. Hovering over it or focusing it opens a menu of every language; on a touch screen a tap switches directly.

The menu always lists every configured language. Choosing one opens the translation of the current page when there is one, and that language’s home page when there is not. The home page beats a 404, but readers may not notice they have moved, so treat “every page has a translation” as a rule to check rather than relying on the fallback.

A missing translation is never filled in with the original

If a page has no Chinese version, the Chinese site has no such page: its sidebar, search index and page order leave it out.

Search engines see only real translations: hreflang lists the current page and its actual translations, never the home page fallback. See canonical URLs and language alternates. Local search also works per language, so a search on a Chinese page finds Chinese content, including unspaced Chinese, mixed-language queries and technical identifiers; see Search.

Duo view

Duo View lets a reader open a page beside one of its translations, which helps anyone checking a translation or reading in a second language. Turn it on with:

hugo.yaml
params:
  ui:
    compare: true

On Docs, Book and blog pages with a published translation on the same site, an Open duo view button appears beside the page actions. Readers can also start Duo View from the command palette, or press B when keyboard navigation is on (try it on this page), and press B again to return. The current page stays on the side where reading starts and the other pane loads the translation; on a page with more than two languages, readers pick the target language from the toolbar menu. Below 900px the view becomes a single pane with a language toggle bar.

The Sync Scroll switch keeps both panes at the same section by matching heading IDs, which is why aligned anchors matter here. When some headings have no counterpart, or the pages share none, it estimates the position between matching headings or from overall progress, and an orange ! beside the switch says which; hover, focus or tap it to read the note. When heading IDs are duplicated or ordered differently between the languages, Sync Scroll turns itself off and both panes scroll independently.

Duo View adds no pages to the build: only when a reader opens it does the browser load the two existing HTML pages, in same-origin frames. Pages without a translation, drafts, home page fallbacks and translations hosted on another domain are left out automatically. To keep one language out entirely, both as the page being read and as the translation shown, set compare: false under languages.<lang>.params.ui.

Before enabling it in production, check two things:

  • Analytics snippets in hooks/head-end.html run again inside each pane unless you guard them with window.OinkComparePane; see Analytics.
  • Your Content Security Policy must allow frame-src 'self', and the server must not send X-Frame-Options: DENY or frame-ancestors 'none'; see Content Security Policy.

Right-to-left languages

Declare the writing direction on the language:

hugo.yml
languages:
  ar:
    label: العربية
    locale: ar
    direction: rtl
    weight: 3

<html dir> follows this setting and the theme adds Bootstrap’s RTL stylesheet. The theme’s own CSS uses logical properties, such as margin-inline-start rather than margin-left, so the layout mirrors by itself. Use logical properties in your own CSS too, or your elements will sit on the wrong side in RTL.

Verify

  1. Build from the site root and confirm that both languages produced output. These paths assume English at / and Chinese at /zh/; the index check applies only with local search on:

    hugo --printPathWarnings
    ls public/index.html public/zh/index.html
    ls public/offline-search-index.*
  2. Check the hreflang links of a translated page against SEO behavior: they list only real translations, each blog pagination page has its own canonical URL, and pages after the first omit language alternates.

    # Replace with a page your site actually generates.
    PAGE=public/zh/docs/getting-started/index.html
    test -f "$PAGE" && grep -o '<link[^>]*hreflang[^>]*>' "$PAGE"
  3. On a translated page, switch language from the picker and confirm that the same document opens; on an untranslated page, confirm that the other language’s home page opens rather than a 404.

  4. Search for the same concept in each language and confirm both return results.

  5. Compare the heading IDs of a translated pair as shown under Align heading anchors.

10 - Versions

Publish documentation for several product versions side by side, with a version switcher and a banner that marks unmaintained versions as archives.

A site needs versioned documentation when readers run different releases of your product at the same time and those releases differ in ways a reader acts on: commands, configuration keys, defaults. If most readers can move to the latest release, or old releases differ only in fixed bugs, keep one site and mark the exceptions in the text; a single site is easier to maintain and to search.

OINK treats each version as a separate site: its own Hugo build, usually from its own Git branch or tag, published at its own address. The theme connects those sites with a version menu in the navbar and an archive banner on the versions you no longer maintain.

The version switcher

List the versions under params.versions. When the list is not empty, a branch icon in the navbar opens the version menu, and an icon-only menu in the footer’s bottom bar opens upward with the same entries.

hugo.yml
params:
  # the version this site is
  version: v2.1
  # the menu's accessible name and tooltip (default: Version)
  version_menu: v2.1
  versions:
    - version: v2.1
      url: https://docs.example.com
    - version: v2.0
      url: https://v2-0.docs.example.com
    - version: v1.9
      url: https://v1-9.docs.example.com

An entry shows its version, or its name when it has one. The entry whose version equals params.version, or whose url equals the site’s baseURL (a trailing slash aside), is marked as the current one.

An entry without a url is a gray item that cannot be clicked, which makes a group heading, and name: '---' draws a divider (a url on a divider warns). name accepts inline Markdown:

hugo.yml
params:
  versions:
    - name: '**Current**'
    - version: v2.1
      url: https://docs.example.com
    - name: '---'
    - name: '**Older versions**'
    - version: v1.9
      url: https://v1-9.docs.example.com

The same list feeds “switch version” in the command palette, so the menu and the palette always agree.

By default a menu entry opens the target version’s home page. version_menu_pagelinks: true appends the current page’s path to the target URL instead, so switching version keeps the reader on the same document. The risk is a 404: documentation structure changes between versions, and a page added in v2.1 does not exist in v1.9. This site leaves the option off.

When most versions share a structure and one does not, turn the option on and opt that one entry out:

hugo.yml
params:
  version_menu_pagelinks: true
  versions:
    - version: v2.1
      url: https://docs.example.com
    - version: v1.9
      url: https://v1-9.docs.example.com
      pagelinks: false # restructured since; go to its home page

pagelinks: false is the only per-entry setting; an entry cannot turn page links on when the site-wide option is off. Decide by how stable the structure is rather than by how far apart the version numbers are: one extra click from a version’s home page costs the reader less than a 404.

The archive banner

When you stop maintaining a version, mark its site as a snapshot so that readers arriving from a search engine know to look for something newer:

hugo.yml
params:
  archived_version: true
  version: v1.9
  url_latest_version: https://docs.example.com

With archived_version: true, every page of the site, blog and landing pages included, opens with a banner saying that version v1.9 is no longer actively maintained and that this is an archived snapshot, with a link to url_latest_version. The text comes in the site’s language, so you write none of it. The version number in the banner is params.version; without it the build warns and leaves the banner out, so set both. A url_latest_version that fails the theme’s URL check warns, and the banner appears without the link.

params.version versus params.versions

The two keys look alike but describe different things:

  • params.versions is a list of sites: the versions in the menu and where each one lives.
  • params.version names the version this build is. It marks the current menu entry, supplies the banner’s version number, and is the fallback when a data/download/*.yaml file omits version (see Releases and downloads).

params.version is a label for readers and need not be a Git ref. When content needs a release tag that resolves, such as the version in an install command, declare a separate parameter for it instead of reusing params.version. Both keys are defined in Configuration.

Deployment layouts for multiple versions

Subdomain

baseURL: https://v1-9.docs.example.com/

Versions are fully independent; each needs its own DNS record and certificate.

Subpath

baseURL: https://docs.example.com/v1.9/

One domain collects all search ranking; the host must route each path to a different build.

Build each version on its own: check out its branch or tag, build with that version’s hugo.yml, and publish to its address. Because the menu is part of each build, adding a version means updating params.versions on every branch you still publish and rebuilding those sites; an old site that is not rebuilt keeps its old menu. Archived sites carry the same list plus archived_version: true.

On a subpath deployment, baseURL must include the path segment

Otherwise the search index, page actions and asset links all point at the domain root. The page looks correct, but search returns nothing, which makes this the most common subpath failure. See Deploy for the rest of the host setup.

Verify

Run these from your site’s root after a production build. Replace public/docs/getting-started/index.html with a documentation page your site actually generates, including the language prefix if it has one.

  1. Confirm that the version menu reached the page:

    hugo --printPathWarnings
    PAGE=public/docs/getting-started/index.html
    test -f "$PAGE" && grep -c 'nav-version-menu' "$PAGE"

    With params.versions empty or unset there is no menu at all.

  2. Check that the current version is marked:

    grep -o 'td-nav-hover-menu__option td-is-active[^>]*' "$PAGE"

    No result means that no entry’s version equals params.version and no entry’s url equals baseURL.

  3. Follow each menu link. With version_menu_pagelinks on, switch from a page that an older version lacks and check that the reader lands somewhere acceptable.

  4. On an archived site, open any page and check that the banner is at the top, in the site’s language, with a working link to the current version.

  5. Press ⌘/Ctrl + K and check that “switch version” lists the same versions as the menu.

11 - Taxonomies

Use tags and categories to index pages across directories, with automatic term pages, term cards, rail clouds, and navbar panels.

The directory tree gives each page one place; tags and categories give it more. A PostgreSQL backup guide can live under “Operations” and still be one click away from the “backup” tag, so readers who think in topics rather than in your folder structure find it too. Declare the taxonomies in hugo.yml and tag your pages; OINK generates the term pages, the term cards, the clouds in the right rail and the navbar panel without a template of your own.

This page is an example: the “Categories: Customization” line under its title and the counted chips under the outline in the right rail come from its section’s category, with no configuration on the page itself.

Enabling a taxonomy

Taxonomies are a Hugo feature, so there is no theme switch. Write taxonomies: at the top level of hugo.yml, with the singular name as the key and the plural as the value:

hugo.yml
taxonomies:
  tag: tags
  category: categories
  • The list is complete, not added to Hugo’s defaults: once you write taxonomies:, tags and categories exist only if you list them.
  • The plural is also the URL segment: /tags/, /categories/.
  • disableKinds: [taxonomy, term] turns all taxonomies off.

To classify pages by product module as well:

hugo.yml
taxonomies:
  tag: tags
  category: categories
  module: modules

tags, categories, modules, authors and series, and their singular forms, have translated names in every theme language file. Any other taxonomy is named after its plural (products becomes “Products”). To choose the name yourself, write title / linkTitle in content/<plural>/_index.md and its translations, such as _index.zh.md; that name takes precedence:

content/modules/_index.md
---
title: Product modules
linkTitle: Modules
---

Tagging a page

The front matter key is the plural (the value side of taxonomies), and its value is always a list, even with a single term:

content/docs/ha/patroni.md
---
title: Patroni high availability
description: Managing PostgreSQL failover with Patroni.
categories: [High availability]
tags: [PostgreSQL, Patroni, failover]
---

When a whole section shares a category, set it once in the section index’s cascade instead of on every page:

content/docs/customize/_index.md
---
title: Customization
linkTitle: Customization
icon: fa-solid fa-sliders
cascade:
  categories: [Customization]
---

All six documentation sections of this site do this. A page’s own categories: replaces the cascaded value rather than merging with it, so to add a category next to the section’s, list both.

The term line on a page

Documentation and blog pages list their terms under the title and summary, each linked to its term page; on this page that is “Categories: Customization”. To style the line, target its container .taxonomy-terms-article and the .taxo-<plural> class each taxonomy adds.

By default the line shows every taxonomy except authors and series, whose terms already appear in the byline and the series strip; listing them again as chips would say the same thing twice. To show only some taxonomies, in a fixed order, name them in page_header; naming authors or series there brings them back:

hugo.yml
params:
  taxonomy:
    page_header: [categories]

page_header cannot hide the line; see Limits. The key is listed in Configuration.

Two taxonomies the theme knows by name

authors and series are ordinary Hugo taxonomies with no theme parameters of their own. Declaring them is the whole switch, because the theme has a dedicated presentation for each:

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

What the declaration turns on: portraits and linked names in the article head, names on list rows, and one <dc:creator> per author in the feed.

The term page becomes: the author’s profile. The display name is linkTitle, or title if absent; description is the short introduction and the body the long one; the featured-image resolver picks the portrait.

series

What the declaration turns on: a strip above the article body naming the series, this article’s position and the next part, with the whole list behind a <details>.

The term page becomes: the series introduction, listing its members in reading order rather than newest first.

Writing a blog covers both in full, with the front matter each needs. Two design choices are worth knowing in advance:

  • There is no data/authors file. The term page is the profile, so there is never a second source to disagree with it.
  • Series members are ordered for reading: members with a series_weight come first in ascending order, then the rest by ascending date. Hugo cannot be given that order for a term page, so the theme computes it once and both the strip and the term page use the result.

Term and taxonomy pages

Each taxonomy generates two levels of page:

Taxonomy list/categories/

A heading with the taxonomy’s icon, its localized name (“Categories”) and the number of terms, then one card per term, most-used first, each with its icon (an author’s portrait), name and page count.

Term page/categories/customization/

A heading with the term’s title and page count, plus a “Categories” kicker linking to the list when breadcrumbs are off. The member pages follow, newest first, styled like a blog list.

Term cards appear only on the taxonomy list page; term pages show the rail cloud instead.

Hugo does not transliterate, so a Chinese term gets a Chinese URL: the address bar shows 定制站点 and the HTML carries it percent-encoded. For ASCII URLs, use English terms and give each a display name with title in content/categories/<term>/_index.zh.md, Hugo’s term page content file mechanism.

A term page has no place of its own in the content tree, so it borrows one. When all its members belong to one top-level section, it shows that section’s sidebar tree and root link, so a reader who clicks a documentation tag stays in the documentation navigation. When the members span sections, it shows the site-level tree.

The rail cloud

The right rail of documentation, blog and term pages has one group per taxonomy under the outline, with counted, collapsible chips. A group appears whenever the taxonomy is declared and has terms in the current scope. To hide the clouds and the taxonomy switcher, set toc_taxonomies: false in a page’s front matter, or params.ui.toc_taxonomies: false in hugo.yml for the whole site. This changes only the rail: the page keeps its terms, byline, series and membership.

Taxonomy list pages and term pages start the rail with a taxonomy switcher: one row per declared taxonomy with its icon, name and term count, linking to its list page, with the current one highlighted. A site with a single taxonomy has no switcher. A list page counts its clouds across the whole site and leaves out its own taxonomy, whose terms are already the cards beside it.

Elsewhere the counts are per top-level section, not site-wide. The theme first looks for a section named after the page’s type, so a type: docs page counts within /docs/; otherwise it uses the page’s own top-level section. “Tags: release 4” on a blog page therefore means four posts in the blog, not four pages on the site.

Each taxonomy has two built-in icons: one for its group heading and one for each term chip.

Taxonomy Group icon Term icon
categories fa-solid fa-folder-open fa-solid fa-folder
tags fa-solid fa-tags fa-solid fa-tag
modules fa-solid fa-cubes fa-solid fa-cube
authors fa-solid fa-users fa-solid fa-user-pen
series fa-solid fa-book-bookmark fa-solid fa-book
Any other fa-solid fa-shapes fa-solid fa-shapes

Override them by plural name. A string sets both icons; a map with taxonomy and term sets them separately, and a key you leave out keeps its built-in icon. Each value is one Font Awesome class pair:

hugo.yml
params:
  ui:
    taxonomy_icons:
      categories: fa-solid fa-folder
      tags: { taxonomy: fa-solid fa-tags, term: fa-solid fa-hashtag }
      modules: fa-solid fa-cubes

The taxonomy panel in the navbar

A main-menu entry that points at a taxonomy list page opens a panel of term chips with their counts, most-used first. You write no dropdown entries for it:

hugo.yml
languages:
  en:
    menus:
      main:
        - identifier: tags
          name: Tags
          pageRef: /tags
          weight: 60

The older url: /tags/ form works too, because the theme resolves a URL entry to the site page it names before checking whether that page is a taxonomy, so an existing menu needs no rewrite. Other menu options are in Navigation and menus.

Bilingual terms

Hugo counts and links taxonomies per language: /categories/ and /zh/categories/ are separate trees, and a Chinese page belongs only to the Chinese one. Write the terms in each language’s front matter:

content/docs/ha/patroni.md
categories: [High availability]
tags: [PostgreSQL, Patroni, failover]
content/docs/ha/patroni.zh.md
categories: [高可用]
tags: [PostgreSQL, Patroni, 故障切换]
  • The same string in both languages, such as release, still makes two term pages, /categories/release/ and /zh/categories/release/, each counting only its own language. Using English terms on Chinese pages for the sake of consistency therefore gains nothing and shows English chips to Chinese readers.
  • Taxonomy names are translated for the built-in plurals, but term names are not: a term is exactly the string in front matter. Write 高可用 on an English page and its chip shows 高可用.

Running a multilingual site is covered in Languages.

Switching by content type

The rail clouds are a display setting. To keep them in the documentation but hide them throughout the blog, set the switch on the blog index and cascade it to its pages:

content/blog/_index.md front matter
toc_taxonomies: false
cascade:
  toc_taxonomies: false

Which pages belong to a taxonomy is a separate choice, made by the terms you assign. This site, for example, uses categories for sections and tags only on the blog:

Content categories tags Effect
content/docs/** Section-level cascade (the six sections) none The term line has one row, Categories
content/blog/** Per post (release, oink) Per post (Oink, Release) Two rows in the term line, two chip groups in the rail

To take a whole section out of a taxonomy, delete categories from its index’s cascade. To take out one page, write categories: [] in its front matter; the empty list overrides the cascade.

Verify

On a page of your own that has terms assigned, check that:

  • the title area shows the taxonomies chosen by params.taxonomy.page_header;
  • with toc_taxonomies on, the right rail shows term groups with counts, and turning it off hides the clouds but keeps the page’s terms;
  • your taxonomy list page (for example /categories/) lists the terms, and each opens a page of its members.

From your site’s root, replacing both example paths with your own, language prefix included:

hugo --printPathWarnings
PAGE=public/docs/getting-started/index.html
TAXONOMY_DIR=public/categories
ls "$TAXONOMY_DIR"
test -f "$PAGE" && grep -o 'taxonomy-term' "$PAGE"

Limits

  • page_header: [] does not hide the term line: an empty list counts as unset, so every taxonomy is listed. To remove the line, stop tagging those pages, or hide .taxonomy-terms-article in assets/css/project.css.
  • toc_taxonomies: false hides the rail clouds, but no setting limits how many terms a visible cloud shows.
  • Term pages are not paired across languages, so switching language on a term page does not necessarily lead to the same term in the other language.

12 - Repository links and page info

Connect “edit this page”, “open an issue”, and “view history” to your repository. Show last-modified information, contributors, and feedback at the page end.

A reader who spots a mistake should be one click away from fixing it, and a reader who lands on a page should be able to tell how current it is. Point OINK at the GitHub repository that holds your content, and the page action menu at the right of the breadcrumb row gains Edit this page, View edit history and issue links, while the end of each page shows when it last changed and in which commit.

hugo.yml
params:
  github_repo: https://github.com/pgsty/oink.pgsty.com # the documentation source repository
  github_project_repo: https://github.com/pgsty/oink # the product repository (optional)
  github_branch: main # defaults to main
  github_subdir: '' # path from the repository root to the Hugo site root

With these settings, this page’s action menu points to:

Menu entry Target
Edit this page …/edit/main/content/docs/customize/repository.md
View edit history …/commits/main/content/docs/customize/repository.md
Create child page …/new/main/content/docs/customize?filename=change-me.md&value=<template>
Create docs issue …/issues/new?title=Repository links and page info
Create project issue https://github.com/pgsty/oink/issues/new
  • github_repo is the repository that holds your content, not the theme’s; pointing it elsewhere sends readers’ fixes to the wrong place. Without it, the first four entries above are unavailable.
  • github_project_repo is optional: a second repository where readers report bugs in the product rather than in the documentation. It alone controls Create project issue, and it is also where the navbar’s GitHub button points. Leave it out if your readers would not know which repository to choose.
  • github_branch (default main) is the branch your content is edited on, not a deployment or Pages branch.
  • github_subdir is the path from the repository root to the Hugo site. Leave it empty when the site is at the root; set it to website when the repository holds code with the site in website/.

Each key can be set for the site, for one language, in a section cascade, or in a page’s front matter, so one site can draw content from several repositories. The full definitions are in Configuration.

Content from another repository

When a section is copied or mounted from an upstream repository, its edit and history links should lead to that repository. Override the repository keys in the section’s cascade, and use path_base_for_github_subdir to strip or replace the prefix of each page’s source path before it is appended to github_subdir. For files copied into the site, that path is relative to the site root:

content/reference/_index.md
---
title: Upstream reference
cascade:
  github_repo: https://github.com/OWNER/UPSTREAM
  github_project_repo: https://github.com/OWNER/UPSTREAM
  github_subdir: docs
  path_base_for_github_subdir: content/reference
---

content/reference/api/client.md then maps to docs/api/client.md upstream.

For a directory mounted from outside the site, match its absolute source path, not the mount target inside Hugo. Paths are compared with / separators on every platform, Windows included, and keep their filename case:

External source at /srv/upstream/docs/
path_base_for_github_subdir: '^/srv/upstream/docs/'

With github_subdir: docs, /srv/upstream/docs/api/client.md maps to docs/api/client.md. The result must be a non-empty path inside the repository. When an external file matches no mapping, or the result is absolute, starts with a drive letter, is . or climbs out with .., the page gets no Edit, View edit history or Create child page entry; its issue links still follow their own repository settings.

path_base_for_github_subdir is a regular expression. When upstream files have different names from the local ones, give a from / to pair instead; this maps each section’s _index.md to the upstream README.md:

content/reference/_index.md
path_base_for_github_subdir:
  from: content/reference/(.*?)/_index.md
  to: $1/README.md

OINK keeps .md and .zh.md side by side in one directory, so both languages share a path prefix and the expression needs no language directory. After changing it, click Edit this page on a leaf page and on a section index, in every language: an expression that strips too much produces URLs that look right and return 404.

Turning individual entries off

Every entry in the menu has a stable action ID, listed in the page action menu. When your Git host does not support an action, hide its entry with CSS:

assets/css/project.css
.td-page-actions__item[data-td-action='create_child_page'] {
  display: none;
}

The command palette uses the same IDs and still offers an entry hidden this way. CSS can hide a link but cannot correct its target, so when a target is wrong for the whole site, remove the configuration key it comes from instead. To drop the whole menu from one page, set page_context_menu: false in its front matter; see Page parameters.

Create child page opens a new file prefilled from the theme’s assets/stubs/new-page-template.md. Put your own file at the same path in your site, assets/stubs/new-page-template.md, to prefill your own skeleton.

Last modified

The last-modified line comes from Git history, not file modification times, which a checkout resets. Turn on Hugo’s Git support:

hugo.yml
enableGitInfo: true
params:
  github_repo: https://github.com/pgsty/oink.pgsty.com
  ui:
    lastmod_commit: subject # subject | hash | none

The end of the page then reads “Last modified August 17, 2026 · (a1b2c3d)”, and the commit part links to …/commit/<hash>. lastmod_commit chooses that commit part:

Value What is shown
subject (default) The commit subject plus the abbreviated hash
hash commit a1b2c3d
none The date only, with no commit link

Any other value warns (invalid params.ui.lastmod_commit) and uses subject.

In CI, set fetch-depth: 0 on the checkout step: a shallow clone, the default in GitHub Actions, contains only the latest commit, so every page shows that commit’s date or none at all. Deploy has the complete workflows. A file you have not committed yet has no Git date, so a new page previewed locally shows no last-modified line. If your build has no Git history at all, leave the line off rather than substituting the build time, which says nothing about when the content changed.

The line belongs to the page’s annotation block, which is on by default; annotation: false turns the block off for one page. The same block also shows where a page came from, driven by its front matter with no template override:

  • Upstream attribution: on a page derived from someone else’s work, set upstream_link with the four required keys upstream_name, upstream_copyright, upstream_license and upstream_notice. The page end then names the work, its copyright holder and license, and links to the full notice. Add upstream_modified: true to say the page was changed downstream.
  • Translation notice: set params.ui.translation_notice to the language code of the authoritative version, and translated pages link back to the original. A page written natively in its own language opts out with translation_notice: false.

Both families are defined in full in Page parameters. To change the block itself, override the narrowest of three partials:

layouts/_partials/annotation-items.html
Add, remove or reorder the lines, keeping the theme’s markup, icons, print rules and accessible label
layouts/_partials/page-meta-lastmod.html
Replace the markup those lines render as
layouts/_partials/page-annotation.html
Replace the block’s outer container

What the page end is made of

Every reading layout ends a page with the same five blocks, always in this order:

Order Component Theme default Page switch
1 Share Off (params.ui.share is empty) share: false, or the page’s own list
2 Feedback Off feedback: true / false
3 Annotation On annotation: false
4 Pager On for docs / book / blog pager: false
5 Comments On when fully configured comments: false

The order follows what a reader does after the last paragraph: pass the page on, say whether it helped, check where it came from, move to the next page, join the discussion. Share comes first because a reader who wants to pass a page on has decided that before being asked whether it helped. The share bar is configured in Writing a blog, the pager in Navigation and menus, and comments in Comments.

The feedback widget

The feedback widget asks “Was this page helpful?” with Yes and No buttons, and after No offers four optional reasons, so you learn which pages fail readers without running a survey. It is off by default:

hugo.yml
params:
  ui:
    feedback:
      enable: true
      reasons: true # whether to ask for a reason after "no"

A blog usually keeps just comments, so you may prefer to turn the widget on for the documentation section only, with a cascade:

content/docs/_index.md
---
title: Docs
cascade:
  feedback: true
---
  • One click completes it: there is no text box, no submit button and no sign-in.
  • The browser keeps the choice in localStorage per page and language, so a returning reader sees it and can change it.
  • When the site has Google Analytics (gtag), the widget sends a docs_feedback event with result (solved / not_solved), page_path and language. Choosing a reason sends a second event that adds reason and refinement: true, so it is not counted twice. Without analytics the widget still works and reports nothing; it needs no backend.
  • When the page has comments, an “Add details in the comments” link appears under the answer. The widget never writes a comment on the reader’s behalf.

This page turns the widget on in its front matter, so you can try it at the end of the page.

The contributor wall

The contributors shortcode shows a grid of GitHub avatars for the people behind a project. It reads a file in your site’s data/ directory and never contacts GitHub at build time:

data/contributors.yaml
items:
  - github: Vonng
    name: Ruohang Feng
    role: Theme author
  - github: pgsty
    name: Pigsty
    role: Project organization
  - github: gohugoio
    role: Static site generator
    avatar: /icons/logo.svg
Source
{{</* contributors */>}}
  • github is required and must be a valid GitHub username; a repeated username warns and is skipped.
  • name defaults to the username, and role is optional.
  • url defaults to https://github.com/<github>.
  • avatar is optional. Without it the entry shows an initial and the page makes no network request; with it, the value must be an http(s):// URL or a path from the site root.

For several lists, keep one data file per list and name it with data=; class= adds classes for your own CSS:

Source
{{</* contributors data="maintainers" */>}}

In Markdown and RSS output, the grid becomes a list of - [@handle](url) — role lines.

This site has no data/contributors.yaml

The example therefore does not render on this page. Add a data file to data/ to render it.

Verify

From your site’s root, build and list the action links of a page whose source belongs to the configured repository. Replace the example path with one of your own pages:

hugo --printPathWarnings
PAGE=public/docs/getting-started/index.html
test -f "$PAGE" && grep -o '<a[^>]*data-td-action[^>]*>' "$PAGE"
  • The link with data-td-action="edit_page" points to github.com/<your repository>/edit/<branch>/<source path>, and every segment of the source path matches the real file.
  • A section index (_index.md) gets a correct source path too.
  • The page end shows a last-modified line, except on a new page that is not committed yet.
  • Page parameters — annotation / feedback / pager / page_context_menu and the other page switches
  • Configuration — full definitions of github_*, ui.lastmod_commit and ui.feedback
  • Comments — the last block at the page end
  • Analytics and SEO — where feedback events are sent
  • AI-agent support — the Markdown and assistant entries in the action menu

13 - Print

Print one page with the browser’s Cmd/Ctrl+P. Use the print output format to combine a section into one continuous document.

Documentation ends up on paper more often than you might expect: a runbook taken into a server room with no network, a chapter handed out at a training, a PDF attached to a change request. Any single page already prints cleanly with the browser’s Cmd/Ctrl+P: the navbar, sidebar, outline and buttons carry Bootstrap’s d-print-none class and stay off the paper, so the theme needs no “print this page” button. For a whole section or book, turn on the print output format. Every section then gets a print view that joins its pages, in sidebar order, into one document with a table of contents, ready to print or save as a PDF.

Enabling whole-section print

The theme defines the print output format but leaves it to the site, because it adds a page per section to every build. Add it to section in your hugo.yml:

hugo.yml
outputs:
  home: [HTML, markdown, LLMS]
  page: [HTML, markdown]
  section: [HTML, RSS, print, markdown]

Each key under outputs replaces the list for that page kind rather than adding to it, so keep every format the kind already had (here HTML, RSS and markdown); a format you leave out is no longer generated.

Each section’s print view lives under _print, which comes right after the language prefix:

Page Print view
/docs/customize/ /_print/docs/customize/
/docs/ /_print/docs/
/blog/release/ /_print/blog/release/

Readers reach it through Print entire section in the page action menu, or by searching the command palette for the same action (print_section). It prints the section the page belongs to: from /docs/customize/print/ it prints the whole Customization section, not just this page.

The structure of a print view

A print view contains, from top to bottom:

  1. A notice: “This is the multi-page printable view of this section. Click here to print. Return to the regular view of this page.” It appears on screen only, never on paper.
  2. The section title and summary.
  3. A table of contents for the whole section, numbered 1:, 2:, 2.1: by level and linked to anchors in the document.
  4. Every page in turn, titled “number - title” (for example “1 - Configuration”), with its description as a standfirst and its body unchanged.

Pages follow the sidebar order (weight), with subsections expanded in place. Every page after the first starts on a new sheet. The first page does so only when the section index’s own body is longer than 50 words, so that an index of one sentence does not waste a sheet. To change the threshold:

hugo.yml
params:
  print:
    section_break_wordcount: 120

To leave out the table of contents for the whole site:

hugo.yml
params:
  print:
    toc: false

or for one section, in its index’s front matter:

content/docs/components/_index.md
---
title: Components
print:
  toc: false
---

Excluding pages

Some pages add nothing on paper: a page of links, a redirect note, a single large screenshot. Set no_print to leave one out:

content/docs/about/showcase.md
---
title: Showcase
no_print: true
---

no_print affects only the section print view; the page itself still prints with Cmd/Ctrl+P. Sidebar dividers (sidebar_divider) are left out automatically, but when a divider is a section, its child pages stay in the print sequence.

How components look in print

On paper, nothing can be clicked or expanded, so the same rule applies to the section print view and to a single page printed from the browser: interactive components become static, and collapsed content is printed open.

Component Print shape
Callouts Static blocks. All collapsible kinds (- / + / DETAILS) expand. Borders turn gray and backgrounds are removed
Tabs The tab bar disappears and every panel is printed in turn, each under its own heading
Code Blocks Copy and fold controls removed, maximum height and scrolling dropped, long lines wrapped
Tables Complete static tables. On screen the print view keeps keyboard scrolling; on paper the table expands and its header repeats on every page
Images Image and caption kept, zoom removed, width limited to the text column
Gallery The grid becomes a vertical stack
FileTree A static panel with every directory expanded. A split layout keeps its build-time width
Fields The complete definition list, the same as on screen
Math Statically rendered KaTeX / MathML
Mermaid The print view keeps the source and loads no engine. A browser-printed page shows the rendered diagram, or the source if it has not rendered
Markmap The print view keeps the outline source and loads no runtime. A browser-printed page shows the rendered map without its floating notes, or the source if it has not mounted
PlantUML The print view keeps the source and loads no runtime. A browser-printed page shows the rendered image, or the source if it has not rendered
ECharts · Infographic The print view keeps the fenced source and draws no chart. A browser-printed page shows the rendered chart, or the declared options / DSL if it has not mounted
Asciinema · OpenAPI A labeled static link to the recording or specification; none of the three runtimes loads
Timeline · Updates Static axis or heading + metadata line on the light paper palette; avoids page breaks inside entries
Video · Audio Static figure with poster (for video), caption and visible file or watch URL; no <video>, <audio> or <iframe> in the print view
Social Static quoted card with author, body, attachments and original-post link on the paper palette
Maps Numbered place list with coordinates and links; no Leaflet map canvas
Cards / steps / badges / keys Static, with content unchanged

Besides the shell, print leaves out the page action menu, the feedback widget, heading anchor links and inline copy buttons. Before printing a page with diagrams from the browser, wait until they have finished drawing.

Browser print styles

A set of @media print rules, shared by single pages and section print views, lays the page out for paper:

  • A4 paper with 18mm 16mm 20mm margins, 10.5pt body text, and the light palette even when the reader browses in dark mode.
  • Text uses the --td-print-font-family typography token; see Brand and appearance.
  • Headings stay with the text that follows them (break-after: avoid-page), and paragraphs and list items keep at least three lines together at a page break.
  • Tables, images, blockquotes, callouts, cards and tabs avoid breaking across pages where they can. Code blocks may break, and long lines wrap rather than being cut off.
  • A closed <details> always prints open, so collapsed callouts and file tree directories show their content.
  • Links are dark blue and underlined, without the URL printed after them. If your readers need the addresses on paper, add them:
assets/css/project.css
@media print {
  .td-content a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
    word-break: break-all;
  }
}

Put any other print styling in a @media print block in assets/css/project.css; no template change is needed.

Copying into rich-text editors

Readers also copy articles into WeChat, Word or an email. When they copy part of an article and paste it into a rich-text editor, they get typeset text in the same light palette print uses, without the page background, dark-mode colors, heading anchors, copy buttons or line numbers. Selecting the whole page (⌘/Ctrl+A) copies only the article: title, description and body.

  • Headings, lists, quotes, callouts, tables and code blocks keep their structure, with sizes in pixels, so editors that drop stylesheets still show them correctly.
  • Code blocks keep their syntax colors. Copied in dark mode, a code block stays a dark card while the prose around it is dark text on white.
  • A few words selected inside one paragraph copy without formatting and take the style of the document they are pasted into.
  • Pasting as plain text is unchanged.

To restyle the pasted result, override the print palette, for example --td-print-ink or --td-print-quote-line, in assets/css/project.css. To keep the browser’s own copy behavior, set rich_copy: false for the site, or in a page’s front matter for that page:

hugo.yml
params:
  ui:
    rich_copy: false

Each editor filters pasted HTML in its own way, so check an important article in the editor you publish to.

Replacing the print templates

To change the structure, for example to add a running header or a different numbering, override the narrowest partial under layouts/_partials/print/:

print/render.html
The section view’s skeleton: notice, table of contents, the pages in order
print/page-heading.html
The title and standfirst at the top of the document
print/content.html
How one page appears inside the section view
print/toc-li.html
One row of the table of contents

The last three can also be overridden for one content type: a file such as print/page-heading-blog.html or print/content-book.html takes precedence over the generic partial for pages of that type.

A whole book (type: book) prints through its own path, which keeps chapter numbers, figure numbers and cross-references continuous across the book; see Books.

Verify

From your site’s root, build and check that a section where you enabled print has its print view. Replace the example path with that section’s output, including its language prefix if it has one:

hugo --printPathWarnings
PRINT_PAGE=public/_print/docs/index.html
test -f "$PRINT_PAGE"

Then open Print entire section on the running site:

  • The print view contains the section’s pages, without those marked no_print: true.
  • Cmd/Ctrl+P shows no notice, navbar or buttons in the preview.
  • On a page with tabs and a collapsed callout, every panel is open in the preview.
  • In a saved PDF, the page breaks fall where you want them; if not, adjust section_break_wordcount.

14 - AI-agent support

Publish a Markdown copy of every page and an llms.txt index, so AI agents and chat assistants can read the site without scraping its HTML.

More and more of your readers arrive through a language model: a coding agent looking up an option, or a person pasting a page into a chat to ask about it. An HTML page is a poor source for them, because the sidebar, scripts and styles have to be stripped away before the content appears, and what survives is a lossy copy. OINK can publish the same content as plain Markdown instead, so a model reads exactly what you wrote and spends its context on the content.

Three outputs do this: a .md file beside every page, an llms.txt index at the site root that tells an agent what the site contains, and a Copy Markdown button on each page. All three are files written at build time, so they need no runtime service and no content negotiation. The theme turns none of them on; you list them under outputs. Two more outputs serve an agent that reads more than one page: a full-text bundle per top-level section and a navigation tree per language.

A .md per page

markdown is one of Hugo’s built-in output formats. Add it to every page kind that should have one:

hugo.yml
outputs:
  home: [HTML, markdown, LLMS]
  page: [HTML, markdown]
  section: [HTML, RSS, print, markdown]

This is the configuration this site uses. Each key under outputs replaces the list for that page kind rather than adding to it, so keep every format the kind already had, such as RSS and print; a format you leave out is no longer published.

The Markdown file sits at the page URL plus index.md:

Page Markdown
/docs/customize/agents/ /docs/customize/agents/index.md
/docs/customize/ (section index) /docs/customize/index.md
/ (site home) /index.md

Every HTML page also announces its Markdown version in <head>, so a crawler does not have to guess the URL:

<link rel="alternate" type="text/markdown" href="https://oink.pgsty.com/docs/customize/agents/index.md">

What the .md contains

The file holds the source you wrote, not a conversion of the rendered HTML. The title becomes an H1 and the description a blockquote, then the body follows as written, with shortcodes expanded in place into their Markdown forms:

the start of /docs/customize/print/index.md
# Print

> A single page goes to the browser's Cmd/Ctrl+P; a whole section becomes one continuous document through the print output format.

---

LLMS index: [llms.txt](/llms.txt)

---

Printing one page needs no configuration: the shell (sidebar, outline, navbar,
buttons) all carries `d-print-none`, so the browser's `Cmd/Ctrl+P` yields a
clean body.

Native Markdown components keep their source: callouts, tables, field lists, image attribute lines, code fences and data fences reach the model exactly as you wrote them. A section index adds a Section pages: list of links to its children after the body, and when backlinks are on, a page ends with a Backlinks: list. Every list and label in the file is in the page’s language.

Each shortcode has a defined Markdown form. A badge becomes emphasized text or a link, a key becomes Ctrl + K, tabs become consecutive **Label** subsections, and fields become an item list. Each component page gives its own form in its Output section.

The LLMS index: line appears only when the site publishes llms.txt, so the file never links to something that does not exist.

llms.txt

llms.txt is a convention for a small plain-text map at the site root: an agent fetches one file and learns what the site contains and where the Markdown versions are. Add the LLMS output format to the home page to publish it:

hugo.yml
outputs:
  home: [HTML, markdown, LLMS]

A multilingual site gets one per language, /llms.txt and /zh/llms.txt, each generated from the site’s structure:

/llms.txt (excerpt)
# OINK

> A local-first Hugo theme for technical documentation

## Site index

- [Home page](https://oink.pgsty.com/index.md)
- [navigation.json](https://oink.pgsty.com/navigation.json)
- [Docs](https://oink.pgsty.com/docs/index.md): Build a technical content site…
- [Blog](https://oink.pgsty.com/blog/index.md): Oink engineering notes, design stories, and reading shell guides

## Documentation index

- [Introduction](https://oink.pgsty.com/docs/about/index.md): A local-first Hugo documentation framework that evolved from Docsy…
  - [Highlights](https://oink.pgsty.com/docs/about/features/index.md): Compare OINK with an ordinary Hugo theme…
  - [Cases](https://oink.pgsty.com/docs/about/showcase/index.md): Find the OINK production case closest to your site…
- [Get started](https://oink.pgsty.com/docs/start/index.md): Start from the official OINK Starter…
…

## Full-text bundles

- [Docs](https://oink.pgsty.com/docs/llms-full.txt)

## Site locales

- [English](https://oink.pgsty.com/index.md)
- [简体中文](https://oink.pgsty.com/zh/index.md)
  • Site index lists this language’s home page, its navigation.json when the site publishes one, and the entries of the main menu (menus.main), linking each entry’s Markdown version when it has one and adding its description.
  • Documentation index lists every page of the documentation section, each indented under its subsection and followed by its description.
  • Full-text bundles appears when at least one section publishes a bundle.
  • Site locales lists every configured language.

Menu entries that point off the site, such as GitHub or an issue tracker, are left out: they are navigation, not content. So to improve llms.txt, edit the main menu and each page’s description; the template rarely needs to change.

Full-text bundle

A .md per page suits an agent that knows which page it wants. An agent that needs the whole manual would otherwise crawl it page by page. The LLMSFULL output gives it one file instead: an llms-full.txt per top-level section, holding every page of that section in reading order.

You turn it on in the section index’s own front matter, not in the site configuration:

content/docs/_index.md
---
title: Docs
outputs: [HTML, print, RSS, markdown, LLMSFULL]
---

Front matter outputs replaces the site-level list for that page, so repeat the formats the section already had; leave out markdown or print and the section index loses them. Front matter is per language, so a bilingual site repeats the line in _index.zh.md to get the Chinese bundle.

Each language gets one file at the section root, /docs/llms-full.txt and /zh/docs/llms-full.txt, in the order of the sidebar and pager: the explicit data/docs_nav.json tree for a docs or book section that has one, and the weighted content tree otherwise. Pages hidden from the sidebar with toc_hide are left out of the bundle too.

A separator line with the source URL introduces each page, and the body that follows is byte for byte that page’s own .md:

/docs/llms-full.txt (excerpt)
================
Source: https://oink.pgsty.com/docs/customize/print/index.md
================

# Print

> A single page goes to the browser's Cmd/Ctrl+P; a whole section becomes one continuous document through the print output format.
…

================
Source: https://oink.pgsty.com/docs/customize/agents/index.md
================

# AI-agent support
…

Source: points at the page’s Markdown output, or at its HTML URL when the page publishes no .md.

Only a top-level section can publish a bundle. Listed further down the tree, LLMSFULL produces a warning (“LLMSFULL output requires a top-level section”) and no file. Every published bundle is listed under ## Full-text bundles in that language’s llms.txt, so an agent finds it in the file it already reads.

This site’s docs section publishes one: https://oink.pgsty.com/docs/llms-full.txt is the entire English documentation in one file.

Navigation JSON

The sidebar is the site’s table of contents, and an agent that can read it can plan which pages to fetch before fetching any. The NAVJSON output publishes that tree as navigation.json, one file per language at the language root. Turn it on for the home page:

hugo.yml
outputs:
  home: [HTML, markdown, LLMS, NAVJSON]

This produces /navigation.json and /zh/navigation.json, built from the same tree as the sidebar and pager: the explicit data/docs_nav.json tree for a docs or book section that has one, and the weighted content tree elsewhere:

/navigation.json (excerpt)
{
  "baseURL": "https://oink.pgsty.com/",
  "language": "en",
  "root": {
    "children": [
      {
        "children": [
          {
            "description": "Publish a Markdown copy of every page and an llms.txt index…",
            "id": "/docs/customize/agents/",
            "kind": "page",
            "markdown": "https://oink.pgsty.com/docs/customize/agents/index.md",
            "title": "AI-agent support",
            "url": "https://oink.pgsty.com/docs/customize/agents/"
          }
        ],
        "id": "/docs/",
        "kind": "section",
        "title": "Docs",
        "url": "https://oink.pgsty.com/docs/"
      }
    ],
    "id": "/",
    "kind": "home",
    "title": "OINK",
    "url": "https://oink.pgsty.com/"
  },
  "schemaVersion": 1
}
Key What it holds
id The page path without its language prefix. The same page has the same id in every language
url The absolute URL of this language’s HTML page
markdown The absolute URL of the page’s .md, present only where the page publishes one
title The navigation title (linkTitle, falling back to title)
description The page’s description, where it has one
kind home, section, or page for real pages. external or link for placeholders
children The ordered children, where the node has any

Array order is part of the contract. The theme has already applied the sidebar order and does not serialize weight, so a consumer that sorts the array again ends up with an order that no longer matches the sidebar.

Placeholder rows keep the sidebar’s structure. A manual_link entry becomes an external node with the URL as written, and a manual_link_relref entry becomes a link node with the resolved reference. Neither is a page, so neither has an id or a markdown URL. Sidebar dividers and pages Hugo never renders are left out, while their children stay in place.

The format is versioned: schemaVersion is 1, and the theme repository publishes its JSON Schema as schema/nav.v1.schema.json. Validate the file against it if you consume it. When a language publishes navigation.json, its llms.txt lists the file in the site index.

This site publishes it: https://oink.pgsty.com/navigation.json is the live tree.

Agent actions on the page

The page-action menu at the right end of the breadcrumb row has four entries for agents and chat assistants:

Entry What it does When it appears
Copy Markdown Copies this page’s .md to the clipboard. It prefetches on hover, so the copy feels instant This page has a markdown output
View markdown Opens the .md in a new tab This page has a markdown output
Open in ChatGPT Opens ChatGPT with a prompt about this page assistant_links: true
Open in Claude Opens Claude with a prompt about this page assistant_links: true

The first two come with the markdown output. Copy Markdown is also the left half of the split button, shown as a clipboard icon that briefly turns into a check mark after a successful copy.

The two assistant entries are off until you turn them on:

hugo.yml
params:
  ui:
    page_context_menu:
      enable: true
      assistant_links: true

When a reader clicks one, the page builds a prompt from the full URL in the address bar, including the real domain, query string and anchor. In English the prompt reads “Read from so I can ask questions about it.”, and the other site opens with it. Only the URL leaves your site; the page body is never uploaded, and the assistant fetches the content itself. Keep confidential information out of URLs, and mention this third-party hand-off in the site’s privacy statement.

A page can narrow the site policy but not widen it. In front matter, page_context_menu: { assistant_links: false } removes the assistant links from that page, while true has no effect when the site has not turned them on. page_context_menu: false removes the whole menu from a page. See Page parameters.

Your own entries go in params.ui.page_context_menu.links. This site uses one to add a Markdown index entry that opens llms.txt, and sets it per language so that the label is translated:

hugo.yml
languages:
  en:
    params:
      ui:
        page_context_menu:
          links:
            - { name: Markdown index, url: llms.txt, icon: fa-solid fa-list }

The command palette offers the same assistant actions, from the same action list; see Command palette.

Opting a page out of .md output

Set outputs in the page’s front matter. It replaces the whole list, so name only the formats you want to keep:

content/legal/terms.md
---
title: Terms of service
outputs: [HTML]
---

To drop only Markdown and keep a section’s feed and print view, list the rest:

content/blog/_index.md
---
title: Blog
outputs: [HTML, RSS, print]
---

Customizing the output

Most problems with these files are content problems: when llms.txt reads badly, fix the main menu and the description fields before you touch a template. When you do need a different shape, the theme renders the .md output with layouts/all.md, llms.txt with layouts/index.llms.txt, and the two optional outputs with layouts/list.llmsfull.txt and layouts/index.navjson.json. A file of the same name under your site’s layouts/ replaces the theme’s, but a narrower override is usually less work to maintain:

  • Per content type: a typed path such as layouts/blog/single.md or layouts/docs/list.md affects only that kind of content, the way the theme’s own print templates specialize (layouts/blog/single.print.html). Check Hugo’s template lookup order for your combination.
  • Per shortcode: a site shortcode can have an output-format-specific template that gives it a more machine-readable form in Markdown.
  • Per page: for a handful of important pages, writing the content by hand is cheaper than changing a template.

Replacing index.navjson.json makes you responsible for the nav.v1 format: your output must still validate against schema/nav.v1.schema.json for consumers that check it.

Verify

Run these from your site’s root after enabling the Markdown and LLMS outputs. Set PAGE_MD to the generated Markdown file of a real page; the paths assume a docs section, so adjust them and any language prefix to your site:

hugo --printPathWarnings
PAGE_MD=public/docs/getting-started/index.md
ls "$PAGE_MD" public/llms.txt
# Only if you enabled LLMSFULL on docs and NAVJSON on home:
ls public/docs/llms-full.txt public/navigation.json

Against a running preview or the production site, use your own base URL and page path. BASE_URL includes any deployment subpath and, for a translated site, the language prefix:

BASE_URL=https://your-site.example/
PAGE_PATH=docs/getting-started/index.md
curl -fsS "${BASE_URL}${PAGE_PATH}" | head -5
curl -fsSI "${BASE_URL}llms.txt" | head -3
# Only if you enabled LLMSFULL on docs:
curl -fsS "${BASE_URL}docs/llms-full.txt" | head -3

Then check four things:

  • The page’s HTML <head> has rel="alternate" type="text/markdown";
  • Clicking the copy button beside the breadcrumbs and pasting gives Markdown, not HTML;
  • llms.txt contains no off-site links;
  • If you enabled them, every page in llms-full.txt starts with a Source: line, and a page has the same id in every language’s navigation.json.

Limits

  • The theme produces four kinds of machine-readable file: a .md per page, llms.txt, and, when you enable them, llms-full.txt per top-level section and navigation.json per language. sitemap.xml remains Hugo’s own.
  • Bundles belong to top-level sections, and there is no whole-site llms-full.txt. An agent that wants everything reads the section bundles that llms.txt lists.
  • LLMS, LLMSFULL and NAVJSON get no <head> alternate link and no page action. Agents find them at their conventional paths and through llms.txt.
  • Serving Markdown from the page URL itself when a client sends Accept: text/markdown is content negotiation, which belongs to your web server or host, not the theme.
  • The Markdown output is built from the source, so anything drawn only in the browser, such as a chart rendered at runtime, appears in the .md as its fence source, not as a picture.