Architecture contract
This contract describes OINK v1.8.0.
Hugo toolchain
OINK v1.8.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.8.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.8.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.8.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; 123 layers. head-css.html publishes it as css/main.css, or minified, fingerprinted and with an integrity attribute in production |
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. The development version includes the dark Chroma palette for source panels. The visual presets follow the sections so their equal-specificity overrides take effect |
search, compare |
The command palette with local search, and Duo View, for a site-owned shell |
The four smaller stylesheets have no source of their own: each lists layers
that main also loads. 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. No layout may call toCSS, css.Sass or 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 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 owns this contract. It fails when a .scss file
exists under assets/, when a layout calls a stylesheet compiler, or when the
layer lists and the layer files disagree: every listed layer must exist, and
every layer file must be listed. It then builds probe sites with an empty
PATH and checks that they publish the layers in their listed order, that
production output is minified, fingerprinted and carries an integrity
attribute, that each retired SCSS hook warns and reaches no output, and that
the four smaller stylesheets are published for a site-owned shell.
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 main’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. 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. 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.
The bundle concatenates the same semantic Markdown, without td- component markup, in sidebar and pager reading order.
Enabling it 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.
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 for explicit publication steps.
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. It invokes an explicit Chrome/Chromium binary with script-src 'none' CSP.
It produces 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 allow only the loopback origin and data URLs. This includes requests from CSS or SVG.
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. - 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.
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.
All six presets are part of the one stylesheet. 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.
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
from actual translation pages whose language also enables comparison, and emits
a small descriptor. The entry chunk loads the reader on demand; the reader uses
two same-origin HTML frames. No language combinations or new content outputs
are generated. The retained host makes three live documents. Per-viewer
preferences (last target and Sync) live in localStorage under
td-compare-reader, read and written inside try/catch; the restorable
session (target, 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.