Architecture contract
This contract applies to OINK 1.9.0.
Hugo toolchain
OINK v1.9.0 uses plain CSS and is tested on Hugo 0.170+ (no Sass
compiler or Extended edition). It does not test older Hugo releases in CI:
development and checks use the installed Hugo, and CI installs latest.
Neither theme.toml nor module.hugoVersion declares a minimum Hugo version
(dropped in v1.8.0; the v1.7.0 tag still carried one, which Hugo reported only
as a warning). See
Runtime dependencies and 1.9.0 baseline.
Do not enable --panicOnWarning or HUGO_PANICONWARNING. Warnings remain
visible and are reviewed. Invalid-input tests verify their specific warning
and safe fallback output directly.
OINK v1.9.0 contains no Sass: its stylesheet is plain CSS that Hugo concatenates; see Plain CSS stylesheet delivery. Ordinary consumers need no Dart Sass, LibSass, or other Sass executable—a site build needs only the Hugo binary. Releases up to v1.5.1 compiled main and ReDoc styles with Hugo’s built-in LibSass (requiring Hugo Extended 0.168.0 and Go 1.27.3). Later changes must preserve this Hugo-only dependency boundary. Update requirements, checkers, and both language contracts together; historical release and research records retain their original tools.
Go resolves Hugo Modules and is not needed for a prepared classic theme copy; user documentation does not prescribe a Go version.
Repository and assembly
The repository root is a complete Hugo Module theme. It is not a site or npm workspace.
Hugo renders templates and publishes the theme’s stylesheets. Committed browser runtimes and third-party assets need no network fetch during normal builds.
Public bilingual documentation, examples, and browser tests belong to the sibling oink.pgsty.com repository.
The theme keeps only narrow internal regression fixtures under tests/site/. It has no separate public example site.
Generated public/ and resources/ directories are never source.
Vendored runtimes, font families, and Font Awesome glyph definitions are supported distributions. Do not remove them as dead code.
VENDOR.json and bin/check-vendor.py verify their integrity.
OINK includes the complete supported Font Awesome distribution because consumer content can use icons absent from theme templates.
The official compiled Font Awesome CSS is a stable, fingerprinted vendor stylesheet.
It loads before fingerprinted main.css, the theme’s stylesheet, and the site’s own styles.
Site style changes therefore preserve the icon distribution’s fingerprint, while cascade order still lets sites override its styles.
Capability styles, including KaTeX, DocSearch, Swagger, Asciinema, and Leaflet, stay separate and load only when used.
Fingerprints permit immutable URLs. The deployment host controls their HTTP cache headers.
Hugo types docs, book, blog, and swagger select reading shells. params.ui.shell_types may add types.
Landing uses layout: landing. There is no article type or second blog shell.
The shell contract defines immersive pages as a blog presentation.
layouts/_partials/shell/config.html resolves shared shell settings.
Layouts must render through content/render.html before scripts.html because render hooks and shortcodes register capability flags in the Page Store.
Override the narrowest partial. Keep similar base templates separate when merging them would change Hugo lookup precedence.
Runtime dependencies and 1.9.0 baseline
The Hugo toolchain applies to development and CI. The stylesheet
is plain CSS that Hugo concatenates, and the consumer SCSS hooks are retired;
see Plain CSS stylesheet delivery. Contributor browser checks
use Node 26.13.0 and npm 12.2.2; these are not consumer build dependencies.
Blog cards, galleries and external rows read authored fallback summaries through
RawSummary. Hugo’s plainify supplies improved spacing between HTML
blocks; summaries and word counts follow that behavior. Publication CI pins
Pandoc 3.13, EPUBCheck 5.4.0 and Chrome headless shell 157.0.8103.50, with Java 27.
The search close button’s localized accessible name includes its visible
Esc label and exposes aria-keyshortcuts="Escape" for speech and keyboard access.
The refreshed runtime set (26 vendored dependencies in VENDOR.json) includes
DocSearch 5.2.0, Mermaid 12.4.0, KaTeX 0.19.1,
Markmap 1.1.1, Swagger UI 5.36.0, ReDoc 3.2.0, Asciinema 3.19.0,
Infographic 0.2.20, Pako 3.0.3, idb-keyval 6.3.0, PlantUML core 1.2026.10, Viz.js 3.31.0
(Graphviz 16.1.0 and Expat 2.8.5), and Leaflet 1.9.4 (BSD-2-Clause). Font Awesome 7.3.1, Bootstrap 5.3.8,
ECharts 6.1.0, and the font packages remain current
stable releases. VENDOR.json remains the exact inventory.
The main stylesheet retains Bootstrap’s component CSS, including modals,
offcanvas panels and carousels, for use in site-owned markup. A site that uses its JavaScript components
loads its own bundle. The theme no longer vendors bootstrap.bundle.js or
Popper. base.js owns the version disclosure and both main and chrome
include its styles. landing.js enhances the server-rendered download
channels. See the upgrade guide for
changes to site event listeners and CSS selectors.
Mermaid explicitly defaults to layout: dagre, theme: default, look: classic;
the new ELK/neo/color-theme defaults do not silently redraw existing content.
Mermaid 12 needs a browser supporting ES2024 (Safari 17.4 or newer). Loading or
rendering failures retain source. KaTeX 0.19.1 CSS/fonts retain the class
normalization for formulas generated by Hugo’s embedded renderer.
A page with a formula publishes KaTeX’s twenty woff2 faces and a stylesheet that names only those;
the woff and ttf copies stay in the module, unpublished.
DocSearch uses the keyword-search bundle and adapts the existing indexName
setting to the upstream indices API. Ask AI is not enabled.
Markmap uses a local ESM graph built from @markmap/core, parse, render,
view and plugin-math 1.1.1. Its D3 primitives, highlighting and lazy MathJax
are bundled; the old global autoloader, standalone D3 and WebFontLoader are
retired. Every relative chunk is published together. See the
Markmap migration before updating content.
The adapter names SVG link overlays from the parsed Markdown labels and restores
those names and visible keyboard focus across animated folding and redraws.
Included Markmap fences register their capability on the host page.
Notes support keyboard opening and Escape with focus restoration, even if an SVG
redraw replaced the original marker. A document
canvas measures labels after fonts load, avoiding Firefox’s OffscreenCanvas
system-font mismatch.
Opening a note finishes any focus-induced page scroll before showing its panel,
so smooth scrolling cannot immediately dismiss it. Open notes follow live color
and preset changes and are hidden in browser print.
Note links use the article’s link color and remain underlined. After printing,
focus returns to the prior note control, or its marker if the panel closed.
If a note chunk fails to load, the affected map restores its complete Markdown
source and keyboard focus; other maps remain independent.
Each ReDoc reader has a separate local HTML document, ES module and hash router.
Multiple readers cannot take over article anchors or each other’s navigation.
Telemetry is disabled; the two vendor brand images are inlined to eliminate
otherwise automatic CDN requests. Specification URLs remain explicit author
input and can be remote when embedded by a same-origin .td-redoc__frame with
the matching authored URL; direct navigation to the local reader asset accepts
only same-origin specifications. A direct specification link remains outside the frame.
The frame permits downloads and new tabs for links chosen by the reader.
Static outputs contain only that link. See API authoring.
Asciinema retains a recording link before JavaScript enhancement, when its
bundle is unavailable, or if initialization, recording fetch or parsing fails.
A failed active player returns keyboard focus to the link. One failed player
does not stop other components from mounting.
Maintainer builds live in bin/vendor/. Copy that directory outside the theme,
run npm ci --ignore-scripts and node build.mjs, then review the generated
assets, bundled-package inventory, licenses and hashes before importing them.
import-redoc.py makes the two documented image substitutions in the original
npm bundle. The lockfile pins transitive dependencies, including idb-keyval
inside the SVG loader. None of these tools run in an ordinary Hugo build.
Plain CSS stylesheet delivery
The theme contains no Sass, and nothing compiles its stylesheet. The source is
the plain CSS layer files under assets/css/td/. assets/css/td/bootstrap/
holds Bootstrap 5.3.8 as built for the theme, split by Bootstrap component: it
carries the theme’s palette, and theme selectors that share a Bootstrap rule
are written into that rule. The font-face layers are
assets/third_party/inter/{normal,italic}.css and
assets/third_party/ibm-plex-sans/{normal,italic}.css.
layouts/_partials/css/layers.html lists the layers of each stylesheet in
cascade order; a later layer wins a tie in specificity.
layouts/_partials/css/bundle.html takes a name and returns that stylesheet as
a Hugo resource: its layers concatenated with resources.Concat and published
as css/<name>.css. An unknown name warns.
| Stylesheet | Consumer |
|---|---|
main |
Every theme page; 119 core layers (123 in the single-bundle v1.8.0 baseline). head-css.html publishes it as css/main.css, or preloaded, minified, fingerprinted and with an integrity attribute in production |
expo |
HTML Expo layouts and nonempty Blog lists that render a gallery. A fixed gallery and a switchable index both use the Expo toolbar. A fixed list, cards or table index, the releases layout and Print omit it |
landing-page |
Home pages using Landing and pages with the Landing layout, in HTML and Print. Layout lookup is case-insensitive. The bundle includes the two Paper screen overrides |
experimental-presets |
The resolved preset or menu offers GitHub, Ink, News or Terminal. An ordinary page offering only Paper or Slate makes no request for this bundle |
compare |
With comparison enabled, HTML pages reserve its position before project CSS, including custom target types. Opening Duo View fetches the sheet. Panes activate it while parsing the head. Site-owned shells can request it by name. |
redoc.css |
Pages that register ReDoc. It is the single file assets/css/td/redoc.css, outside the layer lists, published the same way as css/redoc.css |
chrome |
A site-owned shell that does not load main: tokens, typography, the six palettes, the site navbar, and the language, theme and appearance controls |
landing |
Landing sections for a site-owned shell, loaded after chrome, including the dark Chroma palette for highlighted code panels. The visual presets follow the sections so their equal-specificity overrides take effect |
search |
The command palette with local search for a site-owned shell |
The stylesheet order is fontawesome → main → expo → landing-page → experimental-presets → compare → project → RTL, followed by the inline font
roles and theme color. Each optional file has a stable cache identity across
pages. The theme chooses files by layout and site configuration before the
body renders, without per-page shortcode assembly through templates.Defer.
The link cache includes the base URL, language, direction, version, role and
ordered bundle names.
A custom HTML layout that embeds Landing can set
{{ .Store.Set "tdStyleLayout/html" "landing" }} before calling
{{ partial "head-css.html" . }} or head.html. In its Print template, set
tdStyleLayout/print to landing. The theme Blog list declares blog in
a block before the head, so a custom type using the generic or Blog base selects
the gallery stylesheet when the list renders gallery controls. A custom layout
that embeds those controls directly can declare expo for HTML.
A standalone Print template can call head-css.html with its Page alone.
Duo View panes inherit the host preset. When a stable-only translation opens
inside a host offering experiments, the pane copies the host’s experimental
stylesheet URL and integrity attributes into the same position before
compare and project. The host also applies later preset changes from
other tabs to both open panes. Outside Duo View, each page checks the saved
preset against its own menu.
Paper’s screen overrides follow Landing’s dark-mode rules. The Expo
introduction has a maximum width of 65ch below 992px and takes the article
width from brand at 992px and above. A site can override either width with
.td-expo-content > .lead in project.css. The core accessibility rules
control the default decoration of focused, hovered and active Landing heading
links. A site can override it with .td-landing-section__head a.
Printed Landing Markdown and Preview body links retain their underline
both from ordinary HTML and from the dedicated Print output. The core print
rule sets --td-landing-print-link-decoration on content links. Its fallback
keeps the Landing reset in a site-owned shell, including when that site sets
a document-wide print decoration on a.
The four stylesheets for site-owned shells (chrome, landing, search, compare) have no source of their own: each reuses layers from the theme’s layer set and keeps its existing name and semantics. A site layout asks for one by name and applies its own minification and fingerprint:
There is no compiler, no build step and no generated file in Git; editing a
layer is the whole change. A layer is flat CSS that concatenates: no @import,
no // comment, and every value written out. A value that was a Sass variable,
such as the 50px navbar height, is repeated where it is used, so change every
occurrence together. Layout code must use plain CSS and avoid toCSS, css.Sass, css.Build and PostCSS.
The layers reference fonts as ../webfonts/…, so every stylesheet is published
under css/, one directory below the site root. Font Awesome’s stylesheet is
published there as css/fontawesome.css. Releases up to 1.5.1 publish
scss/main.css, scss/fontawesome.css and scss/redoc.css; a site layout
that names those paths must follow.
A site’s own rules are plain CSS: assets/css/project.css, then every
assets/css/project/*.css in path order. The theme concatenates them into one
stylesheet, published as css/project.css after main.css and all optional theme bundles and before the RTL
artifact, and minified and fingerprinted in production. Hugo does not transform
it. The three SCSS hooks, _variables_project.scss,
_variables_project_after_bs.scss and _styles_project.scss, are ignored;
each present file warns once per build and the page keeps the theme’s styles.
Consumer Sass variables no longer reach Bootstrap, the font roles or any other
theme rule.
bin/check-stylesheets.py builds probes with Hugo and an empty executable
search path. It reads the layer manifest rendered by Hugo, checks all 52
Bootstrap sources in the 119 core layers, verifies the ordered members of
each optional bundle, and compares the concatenated bytes with the sources.
It checks compiled-style invocations in layouts, retired-hook diagnostics,
custom shells, HTML and Print selection, project/RTL order and the SHA-256
integrity of production links. It shares the custom-property check with
bin/check-shell.py. Each bare var(--td-*) must have a definition in the
same bundle, in core, or in a template or runtime writer. Core must satisfy
its own references without an optional bundle.
The conversion changed no rule. On 2026-11-23, with Hugo 0.170.1, the
production main stylesheet was byte-identical (556,437 bytes) to the last one
compiled from Sass, and the regression fixture’s 683 output files were
identical apart from the stylesheet path. The four smaller stylesheets now
reuse the theme’s layers, so they gained selectors (Bootstrap’s heading, .small
and .mark class variants, and a few .td-content ones); no rule or
declaration changed.
Paper reading pages request the core rules. Offering all six presets adds the palette stylesheet. Visiting Landing or Expo pages can add another file to a session. On Hugo 0.171.0 the 655,253-byte measurement came from an unsplit 1.9 build. The released 1.8.0 comparison measured 645,845 bytes. Both totals exclude Font Awesome.
A rooted version-menu URL that opens a section published by the current edition leaves links into that manual local. Extensionless files in static mounts count as published files. A custom head should call partial "head-css.html" . per page. The older site-wide cached call includes both layout styles for compatibility.
Hugo template access to mounted files and build flags has fallbacks. Search uses synchronous assembly when it cannot establish that deferring is safe, including URL-rewriting builds. A weekly CI canary builds upstream Hugo and checks edition routing and search.
Published v1.5.1 fails on Hugo 0.170, because Hugo then requires Dart Sass. The upgrade guide describes how to convert existing hooks.
Configuration and diagnostics
Theme policy uses params.ui.*. Integrations with multiple settings, such as comments.giscus, plantuml, and drawio, remain top-level.
Boolean features use bare booleans unless they have multiple settings.
Page overrides omit the ui. prefix. Thus params.ui.image_zoom becomes image_zoom, never a front matter ui map.
hugo.yaml declares published defaults. The owning resolver and checker define optional configuration shapes or ranges.
For invalid input, warn with the value, allowed shape, and safe fallback. Then apply the fallback or omit the unsafe feature.
Ordinary builds and previews remain usable.
The theme never calls errorf. check-params.py enforces this rule.
Do not add speculative validation for unreachable states.
There is no generic registry of renamed keys. If a transition needs a migration diagnostic, add a targeted warning to its resolver and a negative test that verifies the warning and fallback. Never read removed keys as a compatibility path.
Network-capable features require explicit configuration and remain disabled when that configuration is invalid.
OINK 1.4.0 renders PlantUML locally when it is enabled without an endpoint;
an explicit plantuml.svg_image_url keeps server mode. Draw.io requires
drawio.drawio_server. Algolia requires appId, apiKey, and indexName.
Maps require map.tiles (an HTTPS template with {z}, {x} and {y}) and
map.attribution; the theme names no tile service. Video-platform players load
only for platforms listed in video_embeds, and only after a reader’s click.
Incomplete configuration warns and sends no request.
Draw.io loads only if rendered content has PNG or SVG candidates. It inspects each distinct image URL once.
Diagram endpoints must be strings with an HTTP(S) URL containing a host or a same-site path.
Unsupported schemes, protocol-relative URLs, backslashes, whitespace, and same-site references without paths warn and disable the integration before runtime selection.
plantuml: true or plantuml.enable: true
without an endpoint selects browser rendering. The two pinned local assets
(@plantuml/core 1.2026.10 and Viz.js 3.31.0) load only on HTML pages with
PlantUML fences. Normal builds and readers need no Java, Graphviz executable,
npm installation, CDN or rendering service. A nonempty endpoint still selects
server mode and retains its validation and svg behavior; invalid endpoints
do not fall through to local mode. No optional libraries, themes, include files
or external resources are downloaded by local rendering. Generated SVG is
displayed as a Blob image, never inserted into the page DOM. Failed input or
loading keeps readable source; dedicated Print, Markdown and RSS keep source
without a runtime.
Editor URLs retain their query parameters and fragments when embedding options are added. Messages must come from the active editor frame and its configured origin; unrelated or malformed messages are ignored. Diagram data is sent only to that origin. Exports must be PNG or SVG data URLs.
The small Mermaid/local-PlantUML scheduler appears only on HTML pages using these diagrams. Large engines load as visible diagrams approach the viewport. Engines are shared, with serial main-thread rendering; no Worker, dependency or build step is added. Scroll/size checks replace IntersectionObserver when unavailable. Ordinary browser printing cannot wait for asynchronous rendering: completed diagrams show images and the remainder retain source. Dedicated outputs are unchanged.
Asciinema, ECharts, Infographic, Markmap, and Map (Leaflet) follow the same rule on HTML pages.
The page publishes each engine without requesting it.
A component on screen, within a short scroll below, or anywhere above the reader loads its engine and mounts.
One further down waits, a hidden one waits until it is shown, and a Map configured with loading: click waits for an explicit click.
Mounting above the reader would move the text being read, so everything above is due at once.
Until it mounts, a player is its recording link, a Markmap is its source, a geographic Map keeps its numbered place list, and a chart or infographic is an empty frame.
Ordinary browser printing cannot wait for a script: a mounted component prints as it is,
and an unmounted chart or infographic prints its declared options or DSL, as the Print output does.
If an engine cannot load, the chart or infographic shows that source, the player keeps its link, and a geographic Map hides its canvas while keeping its place list.
An engine a site has already loaded itself is used without a second request.
Giscus is requested the same way, when the reader comes within a scroll of the comments or is already past them.
A visit returning from sign-in, whose session is still in the address, and a site that sets loading: eager request it at once.
Interface localization
OINK 1.1.0 expands the native interface catalogs to the complete locale set below. Consumer-authored content still needs its own translations.
OINK ships native interface catalogs for the 31 locale filenames present in
google/docsy@64f51c5,
plus generic zh as the Simplified Chinese default:
These catalogs cover theme UI strings; sites translate their own content. New Docsy locales do not enter OINK automatically: they need a complete OINK catalog and the same review as existing locales.
i18n/en.yaml defines the message schema. Each of the 32 OINK bundles has exactly these keys and native interface text.
An English value may remain only as a reviewed product name, punctuation token, conventional abbreviation, or word shared by the target language.
There are no generated English fallback blocks.
zh and zh-cn use Simplified Chinese. zh-tw uses Traditional Chinese.
Every Hugo release the theme supports accepts locale: zh for the generic zh language
alongside regional Chinese catalogs. A site may also select locale: zh-CN.
Neither choice changes the i18n/zh.yaml filename.
Runtime placeholders such as %s, {count}, and {{ .Count }} may move for natural grammar. Their bytes must stay identical.
Values are strings or Hugo plural-message maps. Plural maps use supported locale categories: zero, one, two, few, many, and other.
other is required. Each form must be a string with the same placeholders (except reviewed lexical plural forms such as Arabic dual two, which express the count natively without repeating the raw digit).
Catalogs contain no hidden bidirectional controls.
Arabic, Persian, and Hebrew direction comes from consumer language configuration (direction: rtl), not injected translation characters; cursive RTL locales (ar, fa) also reset positive letter-spacing on tracked display labels to preserve glyph joining.
bin/check-i18n.py checks locales, schema, template key references, value shapes, placeholders, directional controls, and the small reviewed set of English-identical terms.
Translate every new visible string in every bundle in the same change. Do not generate fallback text.
Featured images
Hugo’s images is the single authoring API. params.images supplies only the site-wide social fallback.
| Source | Reader thumbnail | Social card |
|---|---|---|
Page images, or bundled **featured*, *feature*, {*cover*,*thumbnail*} |
yes | yes |
Section cascade.images |
yes | yes |
Site params.images |
no | yes |
images: [] clears explicit or cascaded values but does not disable bundle resource discovery.
Only the first resolved image represents the page. Local processable rasters may be cropped.
SVG, static, and remote resources remain valid without Hugo image operations.
featured-image-resolve.html defines source priority and relative or absolute URLs.
Explicit page images take precedence over bundle resources. Bundle resources take precedence over inherited cascade images.
This order also applies when explicit and inherited values are identical.
For file-backed pages, authored presence is read from source front matter. Hugo parses YAML, TOML, or JSON.
For generated pages without source files, resolved images count as explicit.
List thumbnails, Open Graph/Twitter/schema helpers, author avatars, Pinterest media, and blog presentation all use this decision.
params.ui.featured_image applies only to blogs and defaults to none. Page front matter or cascades can override it.
banner adds a figure above single-page titles. wash colors the header.
hero fills the shell background on single pages and section indexes.
Missing images and non-HTML outputs render no image.
An article mode re-encodes a processable image as WebP: banner crops it to 1600×900, hero resizes it to 1800 pixels wide and wash to 1200.
That image is the page’s largest paint, so it is requested with high fetch priority and is never lazy.
A row on a list or term page loads its thumbnail lazily, and a processable image is cropped to the row’s frame instead of sent as the original.
A term row keeps an image that is already no larger than its frame.
Outputs and runtime
Every base template sets Page.Store.tdOutputFormat:
| Output | Contract |
|---|---|
| HTML | Complete semantic content; local runtime only for used capabilities |
| Expanded content; no shell navigation, search, or zoom runtime; the shared action layer supports explicit print controls | |
| Markdown / LLMS | Source-shaped Markdown without td- component markup |
| LLMSFULL | Opt-in per top-level section: one llms-full.txt per enabled section per language, that same Markdown concatenated in reading order |
| RSS | Safe static summary or explicit omission |
| NAVJSON | Opt-in per site: one navigation.json per language, serializing the navigation authority the sidebar and pager already read |
| BookManifest | Opt-in ordered JSON handoff for EPUB/PDF packaging tools |
Output formats run in their defined order. A render keeps its mutable format state
stable for the whole output; summary helpers do not restore an earlier format
value into an RSS render.
Within Print, Hugo can render Book pages and overlapping aggregates in parallel.
A cached coordinator for each page creates plain and Book variants in a fixed order. Each caller selects its required form.
Plain Print keeps page-local headings and routed xref URLs. Book aggregates keep namespaced headings and in-document xrefs.
Relative content links resolve against each source page’s HTML URL before its body moves into Print.
This preserves language and deployment prefixes, query strings, and encoded paths in both single-page and aggregate output.
Only actual href attributes are rewritten; matching text in title or other non-link attributes is preserved.
Fragment-only links remain local for heading and footnote namespacing; canonical and external links keep their destinations.
Heading fragments are percent-decoded once for namespace lookup, including Unicode and encoded ASCII.
Literal plus signs remain plus signs; malformed escapes remain unchanged. HTML entities in IDs and attributes are decoded separately.
The path, query, and external origin are never changed by fragment normalization.
Rendered Markdown headings inside Tabs and other Markdown shortcodes receive the same namespace, even when Hugo omits them from Page.Fragments.
Their rendered heading IDs own the identity, preserving Chinese text, literal plus signs, and percent sequences without deriving IDs from escaped self-link URLs.
Configured RSS output on a Landing page generates a static feed through the shared RSS renderer. An advertised alternate output must have a generated file; omitting interactive Landing components does not omit the feed itself.
Print is a browser-readable document before it is sent to paper. On screen, wide tables stay inside labelled, keyboard-focusable scroll regions without widening the page. Print-media CSS expands these regions for printing. This requires no table runtime; RSS tables remain non-focusable static content.
Consumers opt into custom outputs. OINK does not force expensive Book aggregates.
HTML loads shared action and core layers, plus stable first-party capability chunks selected by page flags.
Actions and core execute before hooks/body-end.html, including on sites that defer optional chunks with a script-resource.html override.
Templated capabilities publish at most one chunk per language. Flags select script tags and never create bundles for feature combinations.
Print keeps the action layer and only runtimes needed by rendered print features.
Large third-party UMD files stay separate. Unused feature runtimes remain absent.
A top-level section enables LLMSFULL by listing it in its _index front matter outputs.
The theme never adds it to site outputs. One renderer creates per-page Markdown and the bundle.
In the development version the two outputs reuse the rendered document for the same base URL, language, version, role and logical page path.
The bundle concatenates the same semantic Markdown, without td- component markup, in sidebar and pager reading order.
In the development version, section Markdown, llms.txt and full-text bundles link to published documents. When a grouping page has no published document, NAVJSON promotes its published children in place. Explicit navigation trees follow the same rule. The AGENTS entry uses its published Markdown output or its page URL.
Enabling LLMSFULL below the top level warns and emits nothing.
Builds remain usable; the warning and absence of the disabled output are checked directly.
Site outputs.home enables NAVJSON. It publishes one navigation.json per language at the language root.
It uses the sidebar and pager authority: explicit data/docs_nav.json when present, or the weighted content tree otherwise.
Array order is the contract. weight is never serialized. The output is notAlternative.
The manually maintained schema/nav.v1.schema.json versions the format.
Edit it with its templates and checker. It is outside the generated configuration schema drift gate.
Both outputs default off. Sites that enable neither build byte-identically. bin/check-agent-indexes.py owns their checks.
Hugo decides which sitemap files to publish. In production the index lists a role, edition and language only when its sitemap has at least one row. An archive whose pages all point to newer canonical URLs still has a sitemap file. Production robots.txt advertises the index, or the nonempty maps on this host when Hugo emits no index. It omits Sitemap when all maps are empty. A role with index: false is excluded from the index in every environment. listed controls the Space menu independently. The page indexing policy in seo/page-indexable.html governs robots, canonical, head alternates and each site’s sitemap. In production, params.ui.noindex (default false) or a page or cascade noindex: true emits noindex, follow and keeps a self-canonical URL. A child can override the cascade with false. Each distinct invalid value warns once and falls back to false. Non-production builds, non-indexed roles, empty sites, the xx language, Print, 404 and theme-generated older-home redirects emit noindex, nofollow. An older-home redirect points its canonical at its destination. Print has one canonical pointing to the same edition’s interactive HTML, or to the Print URL when it is the only HTML document. A 404 omits canonical and hreflang.
For an indexable page in a native non-default edition, the first canonical candidate is the same role, language and logical page in role.defaultVersion. The target must publish indexable HTML on the same origin. If that candidate is absent or ineligible, try the intervening versions from newest to oldest, stopping before the current version. With no eligible counterpart the page keeps its own URL. A version ordered before the role default only tries that default. When a role lacks the global default edition, its first available edition in Hugo order is its default.
Indexable, self-canonical HTML translations in the same role and version form the head hreflang cluster. At two or more members, x-default selects the role’s default language, then the first eligible translation in Hugo language order. The sitemap applies the same rule to translations with actual sitemap rows. It respects Hugo’s global page listing, sitemap.disable, render policy, last modification date, change frequency and priority. It uses the published HTML URL when available and otherwise accepts a published Markdown URL. Non-production site sitemaps have an empty <urlset>. Reader language menus continue to use published HTML destinations.
layouts/_partials/schema.html emits one Schema.org JSON-LD @graph on interactive HTML pages using jsonify | safeJS. Home pages emit WebSite, docs/book/swagger articles emit TechArticle, blog posts emit BlogPosting, and author terms emit ProfilePage with a Person main entity. Pages and sections with the Landing layout emit WebPage for every capitalization of its name. Other collection indexes emit CollectionPage. Taxonomy authors take precedence over the author byline. HTML metadata, Open Graph, Twitter cards and JSON-LD share a plain-text description. Blank values fall through to the summary with HTML markup removed, then to the site description. Social cards preserve literal characters in titles. The blog list publishes a URL for each archive page. Open Graph and JSON-LD identify that page. A custom layout such as releases only paginates if its own template requests it. Open Graph accepts one media URL or a list in audio and videos, publishing up to six valid URLs per field. Related series links require published HTML on the same site. The visible breadcrumb and BreadcrumbList use the same shell decision, ancestor order and labels. Custom shells that render breadcrumb.html must set .Store.Set "tdBreadcrumbs" $crumbs before head.html and use that same boolean for the visible trail. A trail with at least two addressable items qualifies, including the current page. Print, Markdown, LLMS, RSS, 404, redirects and empty sites omit JSON-LD. The theme emits no legacy microdata. bin/check-output.py and bin/check-version-links.py cover the rendered contracts. Native edition output identifies the version’s position relative to the role default, the logical page and the primary HTML URL. The output checker can therefore verify canonical direction across different slugs and distinguish paginated and Print documents.
BookManifest is disabled unless a Book root explicitly lists it in outputs.
It references existing per-page Markdown and records derived page order, headings, numbered targets, and xrefs.
The theme guesses no publication metadata.
The theme repository provides bin/book-epub.py and bin/book-pdf.py (with shared helpers in bin/book_publication.py) for explicit publication steps, and bin/check-book-epub.py and bin/check-book-pdf.py validate their artifacts.
The EPUB packager combines BookManifest with whole-Book Print HTML and accepts consumer metadata separately.
The PDF runner serves Print output at a temporary loopback address and invokes an explicit Chrome/Chromium binary under script-src 'none' CSP to produce A4 pages with CSS page numbers.
The PDF server also applies a CSP sandbox, rejects meta-refresh navigation, and refuses symlinks outside the build tree; without network opt-in, image and media requests—including CSS and SVG subresources—allow only the loopback origin and data URLs.
Both packagers and both artifact checkers require BookManifest schemaVersion: 1, an HTTP(S) baseURL with a host, and a nonempty list of page objects.
EPUB additionally requires a nonempty string path and aggregateId on every page in both the packager and the checker.
Both tools resolve deployment prefixes containing spaces or Unicode text, such as /my%20book/ or /%E4%B9%A6/; in EPUB, a local image link ending in literal%2520code.png embeds the file named literal%20code.png.
Both tools refuse missing resources and resources outside the build tree. Network resources and output replacement each need a separate explicit flag. Network opt-in permits only passive HTTP(S) media. Remote scripts and local-file schemes remain invalid. Relative EPUB metadata assets resolve from the metadata file’s directory, not the working directory. Ordinary Hugo builds run no publication steps. PDF remains derived from Print, rather than a separate template output.
Performance rules:
- Do not walk
.Site.Pagesfor every page if a site-level resource orpartialCachedresult can perform the work. - For the stock local-search index, the ordinary HTML shell prepares records in parallel after rendering page content. One worker consumes the site’s prepared records and resolves the resources during its render. Deferred dialogs read those resources after publishing. Watched builds, HTML build statistics, and calls through an enclosing partial use synchronous resolution. Keep consumer partials composable across these rendering contexts.
- Render
.Contentonce. Read Page Store flags only after rendering it. - Emit correct markup. Do not scan the DOM to repair it.
- Group browser work by resource URL, not DOM instance.
- Keep ordinary outputs opt-in when their aggregate cost is material.
- Emit no Speculation Rules by default. First, a named production consumer must measure
Sec-Purpose: prefetchrequests, useful navigations, bytes, and CSP impact. Use a reversiblemoderateexperiment. - Validate reachable author input. Do not validate hypothetical internal states.
bin/measure-baseline.py measures build time, output weight, bundle count, and
shortcode density.
Single-page Print emits the page description once. Section Print carries mathematics capability from every included descendant to the aggregate root, so a formula-free index still loads local KaTeX styles when a child needs them. Formula-free Print documents do not load those styles.
Native version links
A root-relative link first resolves in the reader’s language. If that language has no matching page or route, an article, alias or document published at the exact address in the default language can satisfy the link. The target must belong to the same origin, version and space. Queries and fragments carry through to the destination.
A page URL comes from a Hugo page permalink or content/site-link.html. The resolver accepts page, value and optional quiet. The first page lookup uses the source page’s GetPage. A page configured with build.render: link or never counts as missing. A Markdown-only page can be linked at its published document. Before stripping a leading version, language or role segment, including the directory of a single role published with defaultContentRoleInSubdir, site-destination.html checks site-route.html on the caller’s own site and keeps that route (page) when both host and full deployed path match literally, so a default-edition page published at /v4.1/... is never shadowed by dimension parsing while an archived nested route (/v4.2/v4.1/...) never hijacks /v4.1/.... A source page whose logical path merely begins with a version, language or audience role, such as v4.1/both.md inside v4.2, answers that link, as written or after the deployment path, only when it is published at that very address; the HTML render hook, site-link.html and the deployed-path lookup apply the same test, so HTML and Markdown agree. Explicit version and language segments within the same role (including a redundant /<selfRole>/... prefix) select a peer in the same role and lock any omitted language to the caller’s language. Without an explicit version, a missing page falls back to the default version in the requested language (latest) only when content/version-shared.html resolves version_shared: true on that target page or an ancestor section (inheriting from the default-language translation peer when omitted on a translated section); unshared manual chapters absent from an older edition follow params.links.missing. A page’s own value, as Hugo merges its front matter with the nearest cascade, wins; only an unset page inherits the nearest ancestor’s, at any depth. A section’s own false therefore does not stop an outer cascaded true for its pages: cascade false to close a subtree. Home counts only for itself. Published page outputs and aliases take precedence over the shared static-file fallback. An address that a page, output or alias of another edition or role publishes is never a static file: when the resolver declines it, as with an unshared chapter’s Markdown or .html alias, the link follows the missing-link policy. Local bundle and global asset image lookups (content/image-resolve.html, content/image-process.html, featured-image-resolve.html) resolve resources by clean path and preserve ?query and #fragment suffixes across HTML, processed derivatives, Zoom targets and Markdown figure URLs; the representative image keeps them in og:image, twitter:image, JSON-LD, blog cards, article banners and heroes, and share links. Query strings and fragments survive link resolution and content/redirect-document.html (location.replace preserves location.search and location.hash ahead of <meta http-equiv="refresh">). Cross-host language links carry the destination origin.
Archive directory lookups are scoped to role, version, language and base URL. The same link can open a registered archive in one role and a local page with its own slug in another.
A destination can name a published address instead of a content path. Such a link keeps its address. The resolver places it under the root of the site that publishes it and never replaces it with another page, so the page, redirect or file that serves the address still answers. A relative destination that is not a content path becomes the address a browser would request from the page’s own URL. An alias keeps its published address and takes precedence over a default-version page. With disableAliases: true, front matter alone cannot satisfy a body link. The role boundary audit checks alias paths only for HTML outputs for which Hugo writes redirects. For a redirect supplied by the host, link to its absolute URL or to the final page. A directory link such as /tools/ resolves under the deployment path when the current host’s static mounts supply tools/index.html. Its decoded route is written back percent-encoded, as Hugo encodes page permalinks, so an alias with a literal % is linked as %25. Relative published addresses start at the current output, including a Markdown-only document or a permalinkable alternate HTML format. content/site-route.html also finds an output published under a path of its own, such as /_print/docs/, through its page and by its whole address.
content/link-output.html keeps a route written from the root, such as /docs/install/index.md, on that page’s Markdown output when the whole address matches. A relative .md or .markdown path names a source page or resource. A missing, draft, future or expired source triggers the missing-link policy. A leaf bundle’s own index.md resolves to its page. The edition owns the files Hugo generates for it, including /llms.txt, /navigation.json and section RSS at /docs/index.xml. A link to the sitemap selects Hugo’s published site map. At the site that owns the global sitemap index, its unqualified address opens the index. Shared assets such as /favicon.svg keep their deployment path. The index records published output addresses and declared HTML aliases, including those served by host redirect rules, whether or not the home is rendered. A page published at an address answers it before an alias there, so only that page’s version_shared decides whether the address is shared. Hugo leaves build.list: never pages out of every collection, so their aliases are not indexed: link such a page by its path. Link to a shared static Markdown download from the site root. Older editions mark shared Markdown, HTML and XML files as file. The output checker verifies their published addresses and recognizes sitemap indexes and URL sets by their XML content, including renamed sitemaps. A translated slug can therefore be written as Unicode or percent-encoded text, including in links to another language host. Any home output, including Markdown under a custom format path, establishes the publication root. Markdown destinations encode spaces in a deployment prefix.
A prefixed role derives its publication directory from Hugo’s configured axes, including when its home output is disabled. A default-role edition with no home output and no rendered page, such as one a build cascade switches off, is not one of the role’s editions. A role whose every site is switched off gets no /<role>/ entry: a template cannot tell that full build from a --renderSegments build without the role. content/role-root-redirect.html caches per role (so --renderSegments never emits unrendered role stubs) and evaluates /<role>/ coverage per host tree: when no host publishes a native HTML home at /<role>/, it publishes <role>/index.html with a byHost origin-and-path target map when multihost destinations differ. Hugo copies that file into every host’s tree, so a multihost entry names its targets absolutely, takes its title from the primary host so every copy has the same bytes, and keys byHost by the percent-encoded path that location.pathname reports; if a broad cascade suppresses home on only a subset of multihost trees while another host owns a native /<role>/ page, it warns with [oink-role-entry] rather than colliding with the native home. A front-matter URL override or alias can move a file outside that directory. OINK checks published paths, reports [oink-role-path] with the source file, and the version-link checker rejects these diagnostics when given the matching --build-log. Publish internal and public environments from separate clean directories.
The resolver reports the states page, self, language, latest, version, role, resource, file, missing and external. Unresolved links carry data-td-link="missing" in HTML. A native matrix also marks version switches, default-edition fallbacks and cross-role links (data-td-link="role"). An explicit /<role>/... path targeting another role resolves inside the named role across its live language and edition order; named editions and languages remain binding. A named version makes the link an exact address: as within one role, an omitted language then stays the caller’s whenever the target role has an edition in it, and only a role without one uses its own language order, so one page’s missing translation never switches language. From a non-default role, an unresolved site-root path falls back to the default role using the switcher’s language and edition order, including sparse cells, while requiring version_shared: true before crossing versions whenever the default role already publishes the caller’s edition. Whenever a role with listed: true links to a role with listed: false, site-destination.html returns leakedRole as pure data so site-link.html logs one warning per source file or setting and authored target URL even on cached lookups. Prefixed roles publish their local search index and split body files under their own <siteDir>/ prefix even when the home has no output (stripping baseURL’s subpath before resources.FromString), index.llms.txt omits cross-role menu targets, including same-origin absolute URLs, and js/chunks/google-search.js is static (data-td-search-page supplies the search URL). In an older edition an explicitly host-qualified link back to the same host carries external so its chosen address survives the output audit. A missing target keeps its authored URL. A site can choose warn (default), error or ignore through params.links.missing. Hugo logs one message once. A body link, including a multiline reference or an entry in the Print body, reports its source file using Hugo’s render position. Markdown from site parameters or data is rendered inside every page and is reported once per site without a file. The site menu, params.ui.command_palette.commands and params.ui.page_context_menu.links name themselves, and a URL template is reported as configured. The version and the language follow in brackets when the site has more than one, and the role when it is not the default. Invalid params.links.missing values warn even when all links resolve. A project with multiple native versions or roles resolves configured menu links and explicit versioned exports against the whole matrix, including inside a role that publishes only one version. A single-role, single-version project can configure menu and component URLs served outside Hugo’s page tree, including with the strict missing-link policy. Menus add the deployment and language prefixes once. A component’s relative link stays relative to the reader’s page. A root-relative address under a same-host archive in params.versions keeps its path, query and fragment, even when a local source page has the same path. Both build models resolve dot segments before matching the archive directory. Hugo’s implicit single-version name claims a URL prefix only when the edition is published in that directory. The HTML hook uses .PageInner. Markdown anchors accept HTTP, HTTPS, email and telephone schemes. Other schemes produce a warning and render the label as text in HTML. Raw HTML remains the author’s responsibility.
Semantic Markdown uses the same resolver. Bare link destinations and reference definitions can contain nested balanced parentheses. Standalone Markdown and llms-full.txt preserve the same resolved slug. When a page also publishes HTML, the HTML render hook reports missing links. On a page that publishes only Markdown, a used inline or reference link triggers the same policy. Code examples, image targets and unused reference definitions do not trigger it. It rewrites inline destinations and reference definitions, preserving line breaks when the destination or title starts on the following line. Backticks in a link label can delimit code within the label. Backticks in a quoted link title or an HTML attribute belong to that title or attribute. The export keeps fenced code, code spans, indented code, footnotes and fragment-only references. A fence and indented code are measured from their list item or definition: four columns past that content is code, a tab advances to the next multiple of four, and indented code ends at the first line that is not indented. A reference definition is rewritten only where it opens a block, including quoted definitions and list items. Escaped brackets, unmatched closing brackets and image references keep their authored text. Lists and block quotes can nest in either order. A link inside a bracketed label leaves the enclosing literal text intact. A body in which no destination changes is returned as written.
content/site-peers.html enumerates one dimension at a time. Hugo can lend a page to another site’s collections via sites.complements. Search, backlinks, blog lists, album and release indexes, the reading tree, Print, section Markdown, LLMS, NAVJSON, RSS, sitemap entries and the published-route index use the page’s owning site. A taxonomy feed includes its published local terms. If a lent term bundle hides a local term set to build.list: local, the feed recovers it from its local members. One case remains invisible to Hugo’s page collections: the lender and every local member use list: never, and none of those members belong to another listed term. The term page still publishes, but the parent feed omits it. Publishing a local _index.md for that term with build: {list: local} restores its feed entry and keeps the members unlisted. RSS limits count published items. Links in the body can still explicitly select another edition or fall back to the default. Version and language peers appear separately in LLMS. NAVJSON v1 uses a logical ID relative to the role, edition and language root. Its URLs include the full deployment path. The version checker builds layered content in three versions and two languages. It checks domain-root, subpath and language-specific host deployments and detects unmarked escapes from old versions. It compares the fixture’s Markdown links and literal code against Goldmark’s HTML. On published output it also checks page actions and the generated LLMS index. It reads each LLMSFULL bundle in order and compares each record byte for byte with its separately published Markdown. At an HTML-only source, it stops the comparison for that bundle. The format has no body length to distinguish the next record from a quoted example. Additional builds exercise conflicting aliases and slugs, different editions by language, two roles with version and language directories, and custom output paths.
Trust, CSS, and accessibility
Authors may enable Goldmark unsafe. Configuration and component parameters are not raw HTML.
The shared attribute policy uses an allowlist, validates class tokens, and passes data-* and aria-*.
It warns and removes style, srcdoc, on*, reserved attributes, and unknown attributes.
URL helpers reject dangerous schemes and protocol-relative URLs where local or explicit absolute URLs are required.
Promised remote URLs remain supported. They are never fetched at build time.
Image and Gallery URLs are HTML-attribute escaped after URL validation, including full-size Zoom sources. Quotes and ampersands remain part of the URL; they cannot introduce attributes or be decoded as HTML entities.
Theme output uses td- classes, data-td-* attributes, and --td-* custom properties.
Author markers such as .steps, .cards, .full-width, .wide, and .expand remain unprefixed.
CSS supports RTL, print, forced colors, reduced motion, long tokens, and narrow viewports.
Theme decorative icons have aria-hidden. Only pages with task lists or raw authored Font Awesome elements load the authored accessibility repair.
Reading-container focus distinguishes pointer input from keyboard navigation.
A pointer-focused main region, table viewport, or code pre does not gain an outline merely when another key is pressed.
Tab, blur, or new non-pointer focus clears that exception.
Controls keep their focus styles. Scrollable containers keep tabindex.
The skip-link destination shows a local outline around its title instead of the whole article.
Forced colors retain keyboard focus indication. No global focus-outline reset is used.
Font roles are ui, body, heading, code, display, meta, brand, and print. They use --td-*-font-family properties.
An explicit fonts.ui changes interface text, prose, and headings in every preset, including Paper. An explicit fonts.body, with or without fonts.ui, supplies the prose face and the heading face unless fonts.heading names its own.
params.ui.typography accepts technical or system. Both are part of the one stylesheet and need no runtime.
Since OINK 1.6.0, the stylesheet is plain CSS and reads no consumer Sass variable (1.5.1 and older let legacy Bootstrap/Docsy Sass variables initialize these roles).
params.ui.fonts configures the same roles without an added stylesheet.
It names faces without loading them, so readers must have the family or the site must declare it through its own @font-face.
This key remains outside the network contract.
Values must use plain font-family syntax. The emitted :root block is reconstructed from matched parts.
Unknown roles or unsafe values warn and are individually removed.
The block follows the stylesheet, allowing authored faces to override presets at equal specificity.
Shells inherit site faces and define none of their own. Book numbers and captions use the prose face, not a technical face.
Accent roles are separate. Accent text, including links, external URLs, and inline code, uses the Bootstrap link family and --bs-code-color.
Theme colors never redeclare these properties. Inline code follows the visual preset: Slate keeps the crimson pair; Paper uses ink text on a quiet chip.
Accent backgrounds include selected rows, gray pointer-hover navigation backgrounds, hover washes, outline pills, rails, dots, chip hovers, and hovered card borders.
They also include share-button hover fills, selections, and focus rings.
These use --td-accent, --td-accent-rgb, and --td-accent-hover, which default to the link family.
These are the only properties emitted by params.ui.theme_color.
Shell text uses them too: active outline anchors and Book chapter headings under pointer or keyboard focus use the section color, not link blue.
theme_color and theme_color_dark accept #rgb/#rrggbb. Page front matter and section cascades override site values.
Unconfigured sites emit nothing. Unparseable values warn and keep the default palette.
Resolved colors below 4.5:1 against the theme canvas warn with a suppressible ID but are still emitted.
This check uses the site default preset canvas and is advisory. Only parse failures remove colors.
The light color is required. theme_color_dark without valid theme_color warns and is ignored.
A page therefore receives color in both modes or neither.
If dark color is omitted, the theme lightens toward white in 4% steps until it reaches 4.5:1 on the dark canvas.
Every emitted byte is formatted from parsed integer channels, never author text.
One resolver supplies page colors to both the head block and sidebar root switcher.
Visual presets
OINK 1.2.0 defaults to Paper. params.ui.preset accepts
paper, slate, and the explicit experimental presets github, ink,
news and terminal. Invalid and reserved names (folio, canvas) warn
and fall back to paper. params.ui.preset_menu defaults to false; true
offers Paper, Slate and the site default. A list selects available choices,
including experiments. A list must include the site default; missing it warns
and adds it. The menu lists presets in one order, whatever order a list gives:
Paper, Slate and GitHub, then Ink, News and Terminal, two rows of three in the
Style menu; the t key steps through them in the same order. There is no
page-level preset override.
Hugo renders data-td-preset and data-td-site-preset on every document root,
including 404 and print output. With reader choice enabled, an inline head
script validates td-preset before CSS loads. Selecting the default removes
that storage key. Invalid saved values are removed; blocked storage leaves
in-page controls usable and shows a non-persistence note. The storage event
synchronizes tabs. td-preset-change carries {preset, previous, stored}.
Mode remains independent: data-bs-theme, td-color-theme, and
td-theme-change retain their meaning. The browser chrome color follows the
resolved mode and preset. Without JavaScript, the site default light palette
renders; appearance controls require JavaScript.
Core contains Paper and Slate. The other four palettes share experimental-presets.css. The site-owned chrome bundle includes all six. Slate retains the v1.1.0 base
palette selectors and values. Paper changes palette and selected component
rules without changing shell columns, breakpoints, or global spacing. Paper’s
canvas is warm #f7f6f3 with ink #21201c; its blue links (#2b5f8c, dark
#7db5e6) are also its accent, so selected rows, the outline cursor and
selections are blue. GitHub uses GitHub’s #ffffff and #1f2328 (dark
#0d1117 and #f0f6fc) with its link blue #0969da (dark #4493f8) as the
accent. Ink is the written page and News the printed one. Ink writes ink
#241a10 on paper #f3ead7 with vermilion #a8321b as its accent; the paper
darkens toward #e8dabd at the edges of the window. News prints press black
#161616 on grey newsprint #f0eee8 with one spot blue #1f4f7a for links
and accent, flat, with no radius or shadow. A dark
palette is not its light palette inverted: each preset has a night of its
own, and fonts never change with the mode. Paper keeps its warm dark grey
#161513, Slate its v1.1.0 navy and GitHub GitHub’s own dark. Dark Ink is a
sutra written in gold and silver: silver type #e3ddd0 with gold headings and
accent #dcb766 on indigo-violet paper #1b1730 that darkens to #120f22.
Dark News is the darkroom where the
paper’s photographs were developed: silver type #d8d6d1 on #0f0f0f, links
and accent in safelight orange #f2804a, and a faint glow of that orange in
one corner of the window. Ink and News name the extreme of their canvas shade
--td-preset-canvas-edge, and every text color clears AA there as on the flat
canvas. Dark
Terminal is a phosphor screen used with restraint: pale grey-green type
#c9d2cc on #050806, with phosphor green #3dff7a kept for headings,
links, the accent and the current row’s cursor bar, and amber #e5b45a for
heading marks, emphasis and quotation rules.
GitHub, Ink, News and Terminal set their accents through the optional
--td-preset-accent properties. A published theme_color replaces the
accent in every preset. Every dark palette redeclares every token of its
light palette, including nested dark islands.
Font roles have equal selector specificity: preset, then typography: system,
then the site’s own styles, then head-emitted params.ui.fonts.
brand controls the wordmark independently from display headings. Slate keeps
Inter. Paper uses local IBM Plex Sans for interface, prose and headings. Both
retain Chakra Petch for the wordmark and IBM Plex Mono for code. News sets
prose in a system serif and headlines in Times New Roman (Liberation Serif on
Linux) beside Songti’s heaviest weight, sets the interface, search, menus,
lists, table labels and the dateline in the same text serif, and sets the
wordmark as a masthead in Didot or Bodoni 72 where installed. GitHub uses GitHub’s system stack (-apple-system, BlinkMacSystemFont,
Segoe UI, Noto Sans, Helvetica, Arial) for every text role and GitHub’s code
stack (ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation
Mono). Ink is written by hand in one voice: Latin is Palatino everywhere
(Palatino Linotype or Book Antiqua on Windows, URW Palladio, P052 or TeX Gyre
Pagella on Linux), the page title and the Landing hero upright and sections in
its chancery italic; Han takes Kai in headings and in the interface, search,
menus and lists, and Fangsong in prose, or Song where Kai or Fangsong is
missing. The display role and the wordmark take the heading face; Arabic and
Hebrew headings reach Diwan Thuluth, Arabic Typesetting or Corsiva Hebrew by
glyph fallback. It has vermilion marks, underlined prose links, square
geometry and no shadows. Terminal uses IBM Plex Mono for chrome, headings and prose, teal
links, amber accents, 2 px corners and no shadows; its print role stays IBM
Plex Sans. System typography requests no bundled text face unless the site
explicitly overrides a role. No external font is introduced. Terminal’s
navigation density changes only on desktop; prose measure and mobile targets
remain unchanged. CSS heading marks have empty accessible alternatives and
are omitted in unsupported browsers. Explicit fonts.ui still supplies the
main face (including headings) unless a valid fonts.body or fonts.heading overrides it. See the
experiment record.
Han text uses fonts the reader already has; the theme ships no CJK file. Each preset arranges the Chinese skeletons differently, and Latin and Han share a class wherever they share a line: a sans beside Hei, a serif beside Song.
| Preset | Latin and Han in prose | Latin and Han in headings | Emphasis and citation | Quotation |
|---|---|---|---|---|
| Paper | IBM Plex Sans; platform Hei | IBM Plex Sans; platform Hei | Kai | Text face |
| Slate | Inter; platform Hei | Inter; platform Hei | Kai | Text face |
| Ink | Palatino; Fangsong at size-adjust: 108%, or Song where none is installed, at 17 px |
Palatino, italic for sections; Kai, or Song where no Kai is installed | Kai | Kai |
| Terminal | IBM Plex Mono; platform Hei | IBM Plex Mono; platform Hei | Text face, upright, accent color | Text face |
| News | System serif (Charter, Iowan Old Style, Cambria, Georgia); Song, at 17 px | Times New Roman; Songti Black, or bold Hei on Windows | Kai | Kai, with Latin in italic |
| GitHub | GitHub’s system stack; platform Hei | GitHub’s system stack; platform Hei | Kai | Text face |
Three roles serve this: --td-emphasis-font-family for em, cite, dfn and
an i without a class, --td-heading-emphasis-font-family inside headings, and
--td-quote-font-family for blockquote. A [!QUOTE] callout body uses the
emphasis role. These roles are not params.ui.fonts keys; a site sets them in
its own CSS. Kai comes from OINK Kai, a local()-only face (Kaiti SC,
STKaiti, KaiTi) limited to CJK code points with size-adjust: 114%, declared
both normal and italic so Han is never slanted while Latin in the same phrase
keeps its true italic. A second pair of faces at weights 600 to 900 names only
installed bold Kai (Kaiti SC Bold, Kaiti TC Bold), so Kai headings and bold
Han emphasis draw a real bold; where none is installed that face never loads
and the regular face answers with a synthesized bold. Where no Kai is
installed at all, as on Android, the face never loads and the stack behind it
answers. Fangsong comes the same way from OINK Fangsong (STFangsong,
FangSong), limited to CJK code points with size-adjust: 108% and declared
normal and italic; Ink uses it for prose only. Chinese Windows carries Kai and
Fangsong; macOS readers download them; phones and most Linux systems have
neither, so Ink’s Chinese there reads in Song, or in the platform’s fallback
where no Song is installed by name, as on iOS. A local() alias also reaches
a downloaded face that WebKit hides from a plain family-name lookup. The Ink
and News heading stacks name Microsoft YaHei before serif,
so a Windows system without a usable Song shows a bold Hei; the Ink and News
prose stacks end in STSong and SimSun. These stacks have been reviewed on
macOS only.
Prose craft is shared by every preset. A bare <kbd> draws the keycap of
the kbd shortcode, and list markers use the tertiary ink; GitHub restates
both as GitHub draws them. Headings in a
Chinese, Japanese or Korean passage (:lang(zh), :lang(ja), :lang(ko))
have zero tracking; each preset’s negative tracking applies to other languages.
.td-content sets text-autospace: normal, and code, kbd and samp opt
out; paragraphs, list items and quotes use text-wrap: pretty. Browsers
without these properties render as before. Ink sets every heading at text
weight with a faint ink bleed: the page title upright, sections in the
chancery italic beside upright Kai, gold on the dark paper, under a deeper top
margin; Landing section titles are at text weight too. A section opens under a tapered brush stroke (a 2 px rule under
forced colors), hr is one short tapered stroke, and table and callout labels
are written in the heading face at their own case and weight. Chinese
strong in Ink prose takes vermilion emphasis dots instead of bold. The first
paragraph of a Blog post or Book chapter opens on a three-line initial in the
heading face and the accent ink. This includes a numbered Book branch bundle
with prose and no child index. Index pages keep a plain opening. The current
navigation row carries a vermilion dot. The paper’s shade and News’s glow are screen-only and yield to
the system canvas under forced colors. Ink quotes hang from a 3 px
cinnabar stroke that fades as it descends; Terminal quotes use its accent
rule. Both keep the rule in print and in a typeset copy, where Ink headings
are set in Kai. Terminal’s generated heading marks have weight 400 and
0.12em tracking. Dark Terminal adds faintly glowing green headings, a glow
on a link under the pointer, faint scan lines, the current navigation and
search row as a green cursor bar, and a syntax palette that keeps its parts
apart: keywords in phosphor green, strings in amber, numbers in cyan, names
pale, comments dim.
News sets the page title at its heaviest weight, tight, over a double rule;
the description below it becomes a deck, italic in Latin and upright in
scripts without an italic, and the date line an uppercase line in the
interface serif between hairlines. Each section opens under a thick-and-thin rule, hr is the
double rule, and the site header closes on a double rule like a masthead.
Tables stay open between an ink hairline above the labels and one below the
last row, with uppercase tracked labels. Quotations are pull quotes, a step
larger between a heavy rule above and a hairline below, with no side bar and
their start alignment kept. Callouts, search, menus and the Appearance panel
have square edges. Navigation controls, search keycaps, Landing tiles, article
actions, thumbnails and portrait frames use square edges without shadows.
File trees, tab titles and taxonomy counts follow the same rule. The current navigation row takes a black rule and
bold type instead of a tint. GitHub follows github-markdown-css 5.9.0 and
@primer/primitives 11.10.0 (both MIT): 16 px prose at line height 1.5,
semibold untracked headings with a hairline under h1 and h2, a chain-link
anchor before the heading on wide screens, grey code blocks (a titled block
is a framed file box), every table cell ruled with even rows shaded and the
table as wide as its content, a 0.25em hr, GFM alert colors on callouts, a
4 px bar on the current sidebar row and green primary buttons. Three GitHub
values move for contrast: the dark primary hover is #268838, the light
selected-tab underline #bc4c00 instead of a 2.15:1 coral, and the dark
focus ring keeps the link blue.
Links in running text carry a non-color cue in every preset. News, Ink
and GitHub use an underline at the weight of the surrounding text. In News
the underline is one pixel at half the link color’s strength and takes the
full color on hover or focus; in Ink it is solid in the accent ink under
ink-colored text, and in GitHub solid. Paper, Slate and
Terminal keep weight 600 without an underline.
Running text here means a paragraph, a table cell, a caption, or an item of a
list that has no class or is a .steps or task list. A list with any other
class is a component: its links, such as card titles, Book contents and file
tree entries, keep weight 600 and take no underline in any preset. Heading
anchors, badges, buttons and footnote references are excluded. Inline
code is weight 600 in Paper, Slate and Ink and weight 400 in News,
Terminal and GitHub, where a chip or a border already marks it; bold code is
600 everywhere. These
rules stay at element specificity, so the theme’s semantic code elements and
a site’s own styles still override them. Table cells use tabular numerals. The
table viewport rounds its top corners by 8 px unless a preset frames or squares
it. Dark mode sets grayscale font smoothing.
Paper no longer draws a decorative line to the right of content h2 headings,
in either light or dark mode. Heading typography, spacing, anchors, and normal
wrapping are preserved. Site-authored heading borders remain supported.
Giscus auto palettes follow both dimensions; explicit Giscus theme or light/dark stylesheet overrides remain authoritative. Print uses a light preset palette on white paper even when the screen is dark. Mermaid and ECharts continue to follow mode only; API widgets retain vendor palettes. See the accepted decision and local acceptance record.
Typeset copy
params.ui.rich_copy is a boolean, default true; front matter and section
cascades override it. Other values warn and keep the default. When it is on,
interactive HTML output loads js/chunks/rich-copy.js; print, Markdown, RSS
and LLMS output never do.
The runtime handles the copy event for a single-range selection that touches
article prose (.td-content). It writes text/html and leaves text/plain as
the browser’s own Selection.toString(). It does nothing, so the native copy
proceeds, when another handler already prevented the event, when the selection
is in a form field or editable region, when it lies wholly inside interface, or
when any step throws.
The HTML is rebuilt from the selected nodes, never from the browser’s styled serialization:
- Output uses only
h1–h6,p,a,strong,em,del,u,mark,sub,sup,kbd,code,pre,blockquote,ul,ol,li,table,tbody,tr,th,td,caption,figure,figcaption,img,hr,brandspan. The only attributes arestyle,href,src,alt,start,reversed,value,colspan,rowspan, andclass="language-…"on a code block. Copying several ordered-list items retains their original numbers, including when the selection starts midway through the list. - Links keep absolute
http,https,mailtoandteltargets; other schemes become plain text. Images keep absolutehttp,httpsordata:image/sources. - Dropped: page-end blocks, article metadata, bylines, series strips, page
actions, breadcrumbs, heading anchors, footnote back-references, code
utilities, tab lists, buttons, forms, navigation, embedded frames, media,
canvases, SVG, and anything hidden,
aria-hidden, visually hidden, not rendered or not selectable. A closed disclosure copies its summary only. - Colors come from the
--td-print-*properties: the preset’s light palette on white in either screen mode. Only values that parse as a hex,rgb(),rgba()orcolor(srgb …)color are used; anything else falls back to the built-in palette. Sizes are pixels. No canvas color, custom property,remvalue or web font name is emitted. - A code block keeps its text, filename and token colors, without line numbers.
A light code surface takes the print code tint; a dark one keeps its own
background and ink. Callouts become quotes with a bold title and their tone
as the rule. KaTeX copies as its TeX source between
$or$$. - Inline whitespace collapses as CSS does, except that a source line break between two Han, kana or fullwidth characters produces no space.
- A selection inside one line of prose, one list item, one cell or one line of
code copies as bare markup without
style, so it takes the destination’s formatting. A selection that extends beyond the article copies the article only.
--td-copy-heading-rule (under, over or none) and
--td-copy-heading-font let a preset place the second-level heading rule and
name a heading face for the clipboard. Ink uses over and Kai; Terminal uses
none and a platform monospace stack; News keeps the default rule and names
Times New Roman over Song; GitHub writes out the default under.
tests/js/rich-copy.test.js owns the serializer; bin/check-params.py owns
the setting; the documentation site’s rich-copy.spec.mjs tests real pages in
every preset. Paste results in WeChat, Word and other editors depend on
each editor’s own sanitizer and are not covered by automated tests.
Language suggestion runtime
Hugo renders one inert template per real translation using the target page’s .Render i18n context. A synchronous inline script selects a template before parsing the following content. Navigation or a hero may already have painted on a streamed response. The notice uses system fonts to keep line breaks stable during site font loading. Its copy is marked data-nosnippet. Print, Markdown, LLMS, RSS and the search index omit the feature.
The script compares tags locally. Showing a suggestion starts no network request, writes no storage and sets no cookie. The close listener is ready when the notice is inserted. An enhanced language control, including the active language button, the action link, the palette and the keyboard shortcut, records an explicit choice. Enabled multilingual pages use a core bundle that also supports these controls on pages with no translation. The inline decision has identical bytes across languages within a build.
Preferences are scoped to the source origin. The key td-language-suggest stores the chosen canonical base tag in lowercase and its timestamp. Each td-language-suggest.dismissed.<tag> holds the dismissal timestamp for that exact target. Closing a suggestion for zh-CN leaves zh-TW eligible. Regional variants with distinct target tags are independent as well. Choosing a language clears its old dismissal. Records expire 365 days after the corresponding action. Unreadable storage suppresses the notice. A failed write still lets the reader close it for that document. A storage event or a persisted pageshow removes a stale notice without introducing a new one mid-article. Language domains do not transfer choices.
Translation reader runtime
The sole setting is the boolean params.ui.compare, default false; a language
may override it. Invalid values warn and leave it off. Hugo derives candidates
within the current role from actual published HTML counterparts (via the
transitive closure of .Rotate "version" and .AllTranslations) whose language
also enables comparison, and emits a small descriptor carrying version and
language metadata plus axis availability. The entry chunk loads the reader
(compare-targets.js, compare-scroll.js, document-compare.js) on demand; the reader uses
two same-origin HTML frames. No language or version combinations or new content outputs
are generated. The retained host makes three live documents. Per-viewer
preferences (last language, last version and Sync) live in localStorage under
td-compare-reader, read and written inside try/catch; the restorable
session (target, version, language, Sync, visible pane, semantic bookmarks) lives in
history.state.oinkCompareSession on the reader entry only.
oink_compare_pane=1 activates the internal pane state only in a frame owned by
an open reader. Visiting that URL at top level leaves the normal page intact.
window.OinkComparePane is available before head hooks for custom scripts.
Pane state suppresses shell runtimes and shortcuts, search initialization,
comments and theme-managed analytics, while keeping content runtimes and styles.
bin/check-compare.py classifies every browser runtime as suppressed in panes,
running in panes, or host-only, so a new runtime must declare its pane behavior.
With comparison on, production builds render Google Analytics through the
theme’s pane-aware template instead of Hugo’s embedded partial; a site override
of google_analytics.html therefore does not apply. Frames isolate document IDs;
same-origin content remains trusted site content. Panes need frame-src 'self'
and same-origin framing. Normal canonical links remain the page identity. Print
and machine outputs contain no comparison controls or comparison runtime.
A pane is ready when its bootstrap reports DOMContentLoaded, not when every
image or embed has loaded; a slow resource never holds back or discards a
readable pane. An invalid document fails at its load event or the 15-second
document timeout. The iframe’s initial about:blank load is ignored, but a
document still blank at timeout fails. Browser geometry is measured at readiness and
invalidated on resize, the frame load event, font/image readiness and
disclosure/component layout changes (including td:tab-shown). User input assigns the
active pane; programmatic follower scrolls cannot take ownership. Animation
frames coalesce updates. Continuous owner scrolling is mirrored instantly per
frame, because restarting an eased scroll on every frame stalls the follower; a
single discrete jump eases when motion is allowed, and reduced-motion or
bookmark restoration uses instant positioning. Closing or
replacing a pane aborts its listeners, observers and load timeout. Native
dialog inertness contains host focus; child keyboard handling preserves nested
component and ARIA dialogs, and pane link handling supports SVG anchors. The reader’s history entry survives a reload or a
back/forward restore. The entry runtime binds restoration to that entry’s token
and verifies it again after loading the reader; leaving the entry cancels the
pending restore. Reopening preserves the token and does not write history.
History traversal finishes processing an explicit close or queued user reopen
before automatic restoration runs. Moving the language menu across the narrow
breakpoint preserves its focused control and open state after updating pane
visibility and inertness. The runtime captures focus before changing menu-host
visibility; media-query styles must not hide that host before the change callback.
Release states
Keep local validation, module tagging, consumer pin updates, and site deployment distinct during release workflows.
v1.5.1 review corrections
The v1.5.1 release retains Hugo Extended 0.168.0 and Go 1.27.3. Validation reports must identify the actual toolchain and local module source.
Feeds sort by descending date before applying services.rss.limit, and undated
items omit pubDate. RSS summaries and page feeds can share a page Store within
the RSS pass. Summary rendering keeps that Store in RSS format state instead of
restoring stale HTML state, and preserves manual summary dividers.
Focus indicators use the current preset’s opaque link color. Navbar controls and clipped code/FAQ containers retain visible keyboard focus. Forced colors expose current navigation entries and the footer wordmark. Heading and field self-links remain keyboard-reachable; print links retain their underlines. The local Bootstrap RTL artifact supplies directional rules without replacing the theme’s font roles. Prose list spacing does not apply to component lists.
The configuration schema accepts translation_notice as false or a nonempty
language-code string; the owning resolver checks that the language exists.
Pagination and breadcrumb labels are translated in all 32 locales. Thumbnail
alternative text uses the page title without an English prefix.