Configuration
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:
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:
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:
- The page’s own front matter;
cascadein an ancestor section’s_index.md(the nearest wins);- 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.
A cascade sets a whole subtree at once:
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:
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:
The theme’s keys add the logo, footer text and accent color:
params.logo, ,- Brand mark, from an
assets/resource or astatic/path. See Brand and appearance params.wordmark,- Horizontal wordmark shown beside the logo in place of the site name. Below 992 px the navbar shows the logo alone
params.copyright,- A string renders as Markdown. A map takes
authors,from_yearandto_year;presentmeans the current year params.ui.theme_color,#rgbor#rrggbbaccent for the shell’s colored backgrounds. Prose links and inline code keep their own colors. See Brand and appearance
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, ,- Types that get the reading shell with a sidebar. See Layouts and page types
params.ui.docs_section, ,- Folder name of the documentation section, used only to resolve navigation
params.ui.docs_sidebar_root, ,- Where a docs sidebar starts:
sectionat the documentation section,homeat the site home params.ui.quick_links, ,- Top-level menu identifiers the command palette lists before you type. See Command palette
params.ui.sidebar_root_enabled, ,- Lets a subsection become its own sidebar tree with
sidebar_root_for: self
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.
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, ,- How a post’s featured image appears on its page and in section indexes:
noneshows nothing,bannera 16:9 figure above the title,washthe image behind the article header at one-tenth opacity,heroa full-bleed background behind the shell that moves the opening down. It is the same image as the post card andog:image, so the three always agree. Without an image, every mode shows nothing params.ui.blog_index, ,listhorizontal entries,cardsimage cards,tablecompact rows,gallerylinked covers. All are newest first;tablealways lists the whole section on one pageparams.ui.blog_index_columns, ,- Columns for
blog_index: cardsfrom the xl breakpoint up. Between md and xl there are always two columns, below md one params.ui.blog_index_size, ,- Posts per page for
list,cardsandgallery, and for all four layouts whenblog_index_toggleis on. A standalonetableignores it params.ui.blog_index_toggle, ,- 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, ,- Tile arrangement inside
gallery:wallwith 6px gaps,seamlesswith none,cardsas a masonry with visible captions. Independent ofblog_index params.ui.blog_gallery.size, ,- Target gallery tile size, 160–360 CSS pixels. It does not change the number of posts per page
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.
Navbar and footer
The navbar, the footer and the page-action menu at the right end of the breadcrumb row:
params.ui.dark_mode, ,trueturns on the dark palette and the light/dark control.{ show_menu: true }impliesenable: true;{ enable: true, show_menu: false }keeps the palette without showing the menu controlparams.ui.breadcrumb, ,- Breadcrumbs above the title. A top-level section never shows a one-level breadcrumb
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_cache_limit, ,- 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, ,- Narrowest width, in pixels, the reader can drag the sidebar to on the desktop
params.ui.sidebar_icon_policy, ,- Icon density:
alleverywhere,groupsonly on the root and on entries with children,nonenowhere params.ui.sidebar_headings, ,type: bookonly: shows the current page’s headings as a branch under its sidebar row. Takes an integer from 2 to 4;truemeans 2params.ui.sidebar_enabled, ,- The left sidebar. Usually turned off per page rather than for the whole site
params.ui.taxonomy_icons, ,- Icons per taxonomy, keyed by plural. Each taxonomy has two:
taxonomyfor the whole classification, such as a right-rail cloud heading, andtermfor one term’s badge. A string such astags: fa-solid fa-tagssets both; a map withtaxonomyandtermsets them separately, and a key it leaves out keeps the built-in. Built-in pairs covertags,categories,modules,authorsandseries; 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).
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.pager_types, ,- 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, ,- The “last modified” and provenance block at the end of the body. Upstream attribution comes from the page’s
upstream_linkkeys; see Page parameters params.ui.backlinks, ,- 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, ,- 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
falseto opt out. See Duo view
Search and command palette
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, ,- Builds one local index per language and turns on the command palette. See Search
params.offline_search_on_serve, ,- Builds the index under
hugo servertoo, so the preview searches like production. On a very large site,falsespeeds up local rebuilds params.offline_search_index, ,- How much of each page is indexed, each level adding to the one before:
title,heading,summary,content params.offline_search_summary_length, ,- Length, in characters, of the excerpt stored for each page; a result shows it when no passage matches
params.ui.command_palette.commands, ,- Your own palette commands, each with either a
urlor a built-inaction. See Command palette
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
Image zoom
Images explains which images can be zoomed.
Typography
The visual preset, the fonts and the page widths:
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, ,- Site-wide comment switch. A page overrides it with
commentsin front matter. See Comments params.comments.giscus.term,- The discussion title or number when
mappingisspecificornumber. Omitted when unset params.comments.giscus.lightTheme, ,- 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, ,- giscus theme name or custom CSS URL for dark mode. By default, OINK’s own stylesheet for the active preset
params.comments.giscus.loading, ,lazyrequests the giscus script only when the reader nears the comments, except on return from GitHub sign-in;eagerrequests it at onceparams.comments.giscus.lang, ,- The giscus interface language. When unset, Chinese sites resolve to
zh-CN,zh-TWorzh-HKand other languages use their base code; a language giscus does not support falls back toen params.comments.giscus.ariaLabel, ,- The comment container’s
aria-label. The default is “Comments” in the page’s language params.comments.giscus.errorMessage, ,- Text shown when loading fails. The default is “Comments could not be loaded.” in the page’s language
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,- 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, ,- URL of the product repository, for “Create project issue” and the navbar GitHub entry
params.path_base_for_github_subdir,- Rewrites source paths (normalized to
/) before they become repository links. A map takesfromandto. Content mounted from outside the repository needs an explicit mapping to a repository-relative path. See repository links params.ui.lastmod_commit, ,- What follows “last modified”:
subjectthe commit subject,hashthe short hash,nonenothing params.images, ,- Site-wide social card: supplies
og:imagefor pages without their own image. Metadata only; never shown as a list thumbnail params.upstream_source, ,- Default
data/upstreamsrecord for pages that declareupstream_link. A page’s front matter can override it
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, ,- Turns on the mind-map fence site-wide. See Markmap
params.mermaid,- Configuration passed to
mermaid.initialize(). Keys are lowercase. Dark mode overridesthemeautomatically params.plantuml.enable, ,- Turns on local PlantUML rendering. See PlantUML
params.plantuml.svg_image_url,- Optional PlantUML server endpoint. Without it, diagrams render in the browser
params.drawio.enable, ,- Adds an edit button to
.drawio.svgimages. See Draw.io params.video_embeds, ,- 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, ,- Interactive maps above
mapplace lists. See Map params.map.tiles,- 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,- The plain-text attribution the tile service requires. Required when enabled
params.map.subdomains,- Optional
{s}subdomain characters as a quoted string (e.g.abcd,"01234567"); empty uses Leaflet’sabc params.highlight_classes, ,- Emits Chroma classes for syntax highlighting;
falsereturns to Hugo’s inline styles params.ui.code_copy, ,- Copy button on code blocks.
falseremoves it site-wide; a fence’s owncopy=still wins params.ui.rich_copy, ,- 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:
| 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:
Languages and versions
Languages are defined in Hugo’s own languages block, and the theme reads the
translation links Hugo builds from it:
Paired files, anchor alignment and fallback for untranslated pages are covered in Languages.
Version keys:
params.version,- Identifier of this site variant; it need not be a Git ref. See Versions
Miscellaneous
taxonomies,- Hugo’s own: turns on
tag: tagsandcategory: categories. See Taxonomies services.googleAnalytics.id,- 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:
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:
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.
Related
- Brand and appearance — site name, logo, colors, fonts
- Navigation and menus — navbar menu, page actions, footer
- Layouts and page types — shell, sidebar, table of contents
- Page parameters — the full front matter table
- Troubleshooting — locating a build failure