This is the multi-page printable view of this section.
Design proposals and PRDs
- 1: Backlinks and knowledge graph
- 2: Local search without Lunr
- 3: Media convergence
- 4: Theme roadmap: the Sass exit and the next product stage
- 5: Content components expansion: review and shared design
- 6: Timeline component
- 7: Update component
- 8: Audio component
- 9: Video component
- 10: Map component
- 11: Social post component
- 12: OINK CLI and the next product stage
- 13: oink: preview and multi-version serving from a docs repository
- 14: OINK CLI maintenance roadmap
- 15: Visual presets and appearance switching
- 16: Stabilizing Ink and Terminal for reading
- 17: Ink and News: the written page and the printed page
A proposal describes behavior that may not exist. The contracts, accepted decisions, implementation, and owning checkers define current behavior. Never use a proposal as a configuration reference.
This section contains the authoritative OINK product requirement documents,
RFC-style designs, and unresolved maintainer proposals. Do not create a local
plan/, plans/, proposal/, or parallel design tree in the theme repository
or the documentation repository.
Active proposals
| Proposal | Current boundary |
|---|---|
| Local search without Lunr | Accepted for v1.6.0. All three stages ship in v1.6.0 (scanning BM25 engine with CJK bigrams, split index with staged loading of page text, and fields as search entries) and now live in the Shell and Components contracts; open tuning questions and a later database backend remain non-normative |
| Backlinks and knowledge graph | G1 (static backlinks) is accepted, implemented on the theme’s main branch, and ships with OINK 0.8.0; the local and global graphs (G2/G3) remain draft |
| Media convergence | Partially implemented; the media-result contract and Landing resource metadata shipped, M3 resolved for native-image processing, retirement (M4) open |
| Theme roadmap: the Sass exit and the next product stage | Draft for R1–R3, drafted 2026-11-21. R0 is accepted for v1.6.0: plain CSS assembled by Hugo with no compiler, SCSS hooks retired, and Bootstrap JS removed; no other stage accepted. Orders the exit from Hugo’s removed LibSass, small reader gaps, version lifecycle, and a static API reference |
| Content components expansion | Accepted and shipped in v1.7.0. All six components — Timeline, Update, Social posts, Video, Audio, and Map — expand the catalog from 21 to 27 components with no new shortcode (quoted social posts use > [!SOCIAL] in v1.8.0), one fence (map), and branches in the image, blockquote, and heading hooks; normative behavior now lives in the Components and Architecture contracts |
| OINK CLI and the next product stage | Independent Go repository and first-stage boundary accepted; local CLI candidate implemented, not publicly released; later theme, migration, adoption, versioning, OpenAPI, and platform stages remain proposals |
| Visual presets and appearance switching | Paper/Slate ship in v1.2.0 and all six presets (paper, slate, github, ink, news, terminal) ship in v1.8.0 (see Ink and Terminal stabilization); GitHub, Ink, News and Terminal remain explicit opt-ins; see the accepted decision and dated acceptance record |
| Ink and News: the written page and the printed page | Written 2026-11-28 and partly implemented in OINK v1.8.0. Ink is the written style (Kai and Fangsong, Palatino, headings at text weight, two inks) and News the printed style (newsprint, rules, one spot color), with gold-on-indigo and darkroom dark modes; Japanese and Korean stacks, a kicker and Blog list columns remain open |
| oink: preview and multi-version serving | Draft PRD, written 2026-11-28. One oink binary that embeds Hugo and OINK for local preview, Git-aware multi-version serving and .oink packages, with SQLite-backed search, accounts, comments and page views; would supersede the CLI contract and the CLI roadmap’s versioning stage if accepted; nothing is implemented |
Component refinement, unified diagram reading and local search refinement ship in 1.4.0 and now live under accepted decisions. Translation comparison ships in 1.5.0 as an accepted decision; its draft is retired.
The table-reading draft is also retired: the accepted decision
and component contract define the narrower,
.expand behavior released in OINK 1.4.0.
The bulk agent-index proposal was retired after its outputs were released.
Architecture defines the accepted
behavior. Agent-ready output gives the user steps.
The Book publication proposal was retired after BookManifest and the
EPUB/PDF tools were released. The accepted behavior is documented in
Architecture and
Writing a book; dated downstream adoption evidence
is recorded in Consumer evidence.
Pending consumer adoption does not keep an upstream design proposal active.
Git history retains both proposal drafts.
The generated-configuration-schema proposal completed its lifecycle and was retired: Configuration defines the required behavior, the generated configuration schema decision records the accepted rationale, and Git history retains the draft text.
CLI workspaces and adapters
Explicit workspaces and optional adapters remain in the current reduced CLI. The current contract defines the command boundary, and the R1–R8 and A18 record preserves the historical acceptance evidence. The finite maintenance roadmap remains retired from active navigation.
Where a new PRD goes
Create one English-primary page and its Simplified Chinese peer:
Use explicit, stable English heading IDs in both files. Keep code, keys, paths, versions, and API names unchanged in Chinese. A proposal begins with visible draft status and includes:
- status, owner, date, and affected contract surface;
- context and evidence;
- goals and explicit non-goals;
- proposed behaviour and output/accessibility/security boundaries;
- compatibility and migration impact;
- implementation and owning-checker plan;
- acceptance criteria and open decisions;
- a decision log for later changes to the proposal itself.
For a large experiment, you may add a dated page under
../research/. Keep temporary logs and generated
artifacts outside Hugo content and Git.
Lifecycle
Acceptance does not make the PRD a second contract. Move accepted behavior to the owning contract, stable rationale to Decisions, and user steps to the applicable guide, then retire the proposal from active navigation.
Review gate
Before implementation, confirm that the proposal does not duplicate an existing shell, resolver, component family, or data authority. If the design changes during implementation, update this bilingual proposal before changing the code. Acceptance requires the focused theme checker and the real documentation site. It also requires rendered EN/ZH, applicable outputs, accessibility checks, and responsive review.
Read-only Studio candidate
Studio is removed from the current CLI on 2026-10-04. Use oink dev,
an ordinary editor, and structured inspect/check reports. The
R7 record
preserves historical acceptance of the earlier browser implementation.
Reviewed editing
General source editing is removed from the current CLI. Guarded new,
move, review records, and baseline plans remain. Old editing plans are
rejected. The R8 record
remains historical evidence rather than the current command API.
1 - Backlinks and knowledge graph
On 2026-08-27, all G1 open decisions were resolved and G1 (static backlinks) was accepted. The theme’s main branch implements G1, which is included in OINK 0.8.0. The local and global graphs (G2/G3) remain drafts until G1 supplies real-world evidence. Their names and configuration are not public API until acceptance.
Premise
Reverse navigation and a view of connected pages come from the link graph,
independently of [[wikilink]] syntax. Hugo already accepts ordinary Markdown
links and ref / relref, so OINK can derive a graph from content authors
already write, without another parser, Goldmark extension, or authoring syntax.
The first value is backlinks, not visualization. A static inbound-link list is useful without JavaScript and remains readable in print and Markdown, making an interactive graph an optional enhancement to an already complete list.
Goals and non-goals
Goals:
- derive one language-local link index per build;
- show deterministic inbound links on a page;
- optionally show a bounded local neighborhood;
- optionally publish a whole-site view and a machine-readable graph;
- preserve ordinary preview when an edited link is stale or incomplete.
Non-goals:
- introducing
[[wikilink]]syntax; - indexing external,
mailto:, same-page anchor, or self links; - executing JavaScript to discover links already present in content;
- turning a visualization into the only way to navigate;
- promising perfect extraction from arbitrary shortcode parameters or raw HTML.
Delivery stages
| Stage | Deliverable | Runtime | Independent value |
|---|---|---|---|
| G1 | Language-local link index and backlink list | None | Reverse navigation in HTML, Print, and Markdown |
| G2 | Local graph around the current page | Existing ECharts plus a small local runtime | Spatial view with G1 as the accessible fallback |
| G3 | Global graph page and graph data output | Same runtime | Whole-site exploration and machine-readable edges |
Each stage requires separate acceptance. G1 does not depend on G2. G2 does not require every page to load graph code.
Extraction contract
The proposed index scans source content once per language and records one edge
per source/target pair. After removing fenced code and inline code, it extracts
ordinary Markdown links and ref / relref, resolves internal pages, and
removes fragments for page identity. Self-links are excluded, and repeated
references produce only one edge.
The implementation must test at least:
- duplicate links collapse to one edge;
- fenced and inline code produce no edge;
- external, protocol-relative, mail, same-page anchor, and self links are excluded;
refandrelrefare included;- each language produces an independent graph;
- an unresolved derived edge warns or is reported by the focused checker
without making ordinary
hugo serverunusable.
Raw source scanning has known omissions: it may miss a URL in a custom
shortcode parameter or raw <a href>. These omissions must be documented
rather than hidden behind a claim of a complete semantic graph.
Backlink output
G1 renders an aside group in the right rail beside the table of contents and
taxonomy clouds, placing what points to this page beside what is on this page.
The group is expanded by default and shows the first eight entries, with the
rest behind a native disclosure so a heavily referenced page cannot occupy the
entire rail.
The site key params.ui.backlinks is a bare boolean, off by default.
A page overrides it with the prefix-free front matter key backlinks, which
a section can cascade. Entries sort by stable page path: a language-independent
order that naturally groups related paths without a second ordering authority.
The group uses ordinary links and is omitted when there are no inbound pages.
G1 silently removes derived edges that it cannot resolve. This is a documented limitation of its role as a local navigation enhancement: site-wide broken-link reports would duplicate existing warnings.
Print and Markdown retain the readable list. RSS omits the list unless feed-level research shows that backlinks improve article feeds without adding unnecessary site navigation.
Interactive graph boundary
G2 uses the locally vendored ECharts graph series, with the current page at the center and its direct inbound and outbound neighbors forming the default depth. A hard node limit prevents unreadable or expensive views. Keyboard focus, text alternatives, reduced motion, forced colors, narrow screens, and print are acceptance requirements rather than later polish.
If JavaScript or ECharts is unavailable, G1 remains complete and visible. Only pages that render a graph load the runtime. The runtime must use the existing feature-bundle key to prevent asset-cache collisions between pages with different features.
Global output
G3 may add a dedicated graph page and an opt-in JSON output. The proposed JSON schema contains a version, language, nodes, and directed edges with stable URLs. It would not expose local file paths or unpublished pages. Generate this output from the same index as G1 and G2 so all three representations remain consistent.
Compatibility and migration
Ordinary Markdown remains unchanged and needs no content migration. Configuration names remain undecided until a prototype proves the minimum required surface. Every interactive or global output is off by default. A static backlink list may be considered separately because it supports local navigation without network access or browser state.
Acceptance criteria
Acceptance requires a focused graph checker, extraction fixtures, and HTML/Print/Markdown goldens. It also requires strict-build negative cases, browser accessibility and responsive tests, and a real bilingual-site build. Measure performance on a representative large site.
Open decisions
All G1 questions are resolved (see the decision log). G2/G3 must resolve these remaining questions:
- Does the local graph expose one depth or a tightly capped second depth?
- Which page metadata, if any, is useful enough to enter graph JSON?
- Is G3 useful enough to justify a new output format before G1 and G2 have production evidence?
Decision log
- 2026-08-19: Drafted the three-stage design.
- 2026-08-27: Resolved and accepted G1, scheduled for OINK 0.8.0. G1 is opt-in:
the site key
params.ui.backlinksis a bare boolean, off by default, and pages override it withbacklinks. Shell types do not restrict this policy because it belongs to the site and page. A single stable-page-path sort replaces the section → weight → title chain: one deterministic authority is enough for reverse navigation, while a multi-level sort would introduce a second navigation authority. Unresolvable edges are silently removed, without warnings, as a documented limitation. G2/G3 and graph data output still require production evidence. - 2026-08-27: Design review moved the block from the page end to the right rail. Backlinks are page metadata and belong beside the table of contents, while the page end is the reader’s completion zone: share, feedback, provenance, pager, and comments. The rail group limits visible entries to eight, with the rest behind a native disclosure.
2 - Local search without Lunr
Owner: OINK maintainers. Affected contracts: Shell and Components. All three stages are accepted for OINK v1.6.0 and defined normatively in the owning contracts. This page preserves the design rationale, benchmark evidence, and open follow-up questions.
Status and scope
Local search stays what it is: Hugo writes one JSON index per language, and the
reader’s browser searches it. A site still turns it on with offline_search: true
and needs nothing but the Hugo binary. This proposal changes the engine inside
that boundary, in three stages delivered together in OINK v1.6.0.
| Stage | Change | State |
|---|---|---|
| 1 | One scanning engine replaces Lunr and the substring fallback | Accepted for v1.6.0 |
| 2 | A large index is split: a small navigation index loads first, page text follows by size | Accepted for v1.6.0 |
| 3 | Definitions below heading level become searchable entries | Accepted for v1.6.0 |
A database-backed search is a separate, later design. A database backend later states only what this proposal keeps open for it.
Evidence
Measured on 2026-11-23 with Node 26.13 on one machine. Browser numbers will differ.
The engine in 1.5.1 has two paths. Every term is matched as a substring of each field, and ASCII words also go through Lunr for English stemming and spelling. Lunr builds its index over the whole site on the first such word.
| Problem in 1.5.1 | Measurement |
|---|---|
| The first English query stalls | 271–410 ms on two sites with 1.3–1.7 MB content indexes; 2.5–3.5 s and about 800 MB of heap on a 792-page PostgreSQL manual |
| Every query is slow on long pages | 27–120 ms on those two sites, against an 80 ms input delay; up to 890 ms on the manual, spent mapping excerpt offsets over whole page bodies |
| Substring matches | port returns five pages titled “… Support” first; 435 pages hold the substring, 70 hold the word |
| Unspaced Chinese finds nothing | 7 of 16 queries such as 数据库连接池超时 return no result |
| A stemmed or corrected hit has no location | vaccum finds the VACUUM page with no section and only the page description |
| Operators are dropped | ->> yields no term |
| Ranking ignores rarity and length | Each term weighs the same, and a page counts as one unit however long |
Capacity is a second limit. The largest maintained consumers use summary
scope because their content indexes exceed the budget; content indexes of
5–10 MB exist. Stage 2 addresses that. Stage 1 does not.
On a maintained 163-page site whose content index was 8.1 MB, stage 2
publishes a 609 KB navigation index (123 KB gzipped) and 7.5 MB of page text
(2.4 MB gzipped). First results need the former instead of the whole index.
In a browser, creating the engine again when the text arrives takes 64 ms, and
a query then takes 3–8 ms.
For stage 3, an experimental conversion of the PostgreSQL manual was built
unchanged. Its 7,790 fields per language became entries. A query for
work_mem, shared_buffers or autovacuum_naptime opens the parameter’s own
entry, and does so from the navigation index alone, before any page text is
fetched. That index is 1.7 MB (335 KB gzipped) with the entries in it.
The stage 1 engine, on this site’s content index (166 pages and 1,443
sections per language, about 1.7 MB):
| Measure | 1.5.1 | Stage 1 |
|---|---|---|
| First English query | 198–551 ms | 8–19 ms |
| Median query | 5.2–8.7 ms | 1.6–2.1 ms |
| 95th percentile | 13.4–19.2 ms | 3.4–4.1 ms |
| Expected page in the top five, both scopes | 43 of 46 | 46 of 46 |
The last row counts the 46 curated queries that name a page, in the summary
and content scopes together. Two more expect an empty result and pass in both
engines. The three new passes are Chinese queries typed without spaces. On the PostgreSQL
manual, creating the engine takes 65–112 ms, a query averages 10–16 ms with a
worst case of 32 ms, and retained heap is 19–32 MB. A misspelt word costs
about 140 ms once, to collect the site’s vocabulary.
A prototype of the bigram matching was compared with jieba segmentation plus BM25 on the Chinese manual. Over 35 Chinese and mixed queries the two agreed on 82% of the top ten pages. This measures agreement, not quality.
The engine source is 36.7 KB, or 11.6 KB gzipped. The 1.5.1 engine and Lunr together are 42.1 KB and 12.7 KB.
Goals and non-goals
Goals:
- remove the Lunr dependency and the index it builds in the browser;
- answer unspaced Chinese, Japanese and Korean queries without a dictionary;
- match words at word boundaries, and keep identifiers and operators literal;
- rank with the rarity of a term and the length of a section;
- locate and highlight every match, including inflections and corrections;
- add no configuration key, build step, download or language switch.
Non-goals:
- a segmentation dictionary, WebAssembly, a Web Worker, or a build tool beside Hugo;
- a synonym file;
search_keywordsremains the way to add synonyms; - folding Traditional and Simplified Chinese; this needs a vendored table and a separate decision;
- loading part of an index by query; a Hugo-only build cannot shard by term;
- a remote search provider.
Stage 1: the engine
No index is built. The engine joins all searchable text into one folded string and records where each field of each page and section starts. A query term is located by scanning that string. The scan yields the counts that BM25 needs.
Query analysis
Text is folded with NFKC, lowercased, and whitespace is collapsed. The query becomes pieces in the order typed:
| Piece | What it is | Example |
|---|---|---|
| Word | Letters or digits of a script that separates words | port, репликация, 5432 |
| Identifier | A piece holding -, ., /, \, _, : or =; kept whole |
shared_buffers, --baseURL, /pg/data |
| Symbol run | Two or more characters with no letter or digit | ->>, :: |
| CJK run | Consecutive Han, Hiragana, Katakana or Hangul characters | 连接池, レプリケーション, 백업 |
A character’s Unicode script decides its class. The page language never does:
an English page may quote Chinese, and a reader may type either. A piece is cut
where a CJK character meets a letter or digit, so WAL归档 and WAL 归档 are
the same query and pg_upgrade升级 is an identifier and a run. A path such as
文档/搜索.md stays one identifier.
A CJK run of one character is one term. A longer run becomes its overlapping
bigrams: 连接池 is 连接 and 接池. Nothing decides where a word ends.
What a page must cover is counted in atoms: each word, identifier and symbol run, and each character of a CJK run. A query holds at most 30 atoms.
A short list of English function words and six Chinese question words still match, at a tenth of the weight, and no page is required to contain them. A query made only of such words is searched as written.
Matching
Every match is exact or loose.
| Piece | Exact | Loose |
|---|---|---|
| Word | The whole word | A longer word it begins; another inflection; one part of an underscore name; the inside of a compound, for words of five or more characters; a correction |
| Identifier | Bounded by non-identifier characters | Inside a longer identifier |
| Symbol run | Not next to another operator character | Inside a longer operator |
| CJK bigram | Any occurrence | — |
Inflection uses Porter’s English suffix rules for a–z words. Words of other
alphabets match when they share at least four leading characters and differ by
at most three trailing ones. A word that holds a digit does not inflect.
Spelling help applies only when the selected scope holds no form of the word.
It covers a–z0–9 words of at least five characters, with one edit, or two
from eight characters. A transposition is one edit. The three most frequent
candidates in the site are searched as whole words. Identifiers are never corrected.
Ranking
A page is a complete match when it covers at least 90% of the query’s atoms by weight. An atom weighs the inverse document frequency of its commonest covering term. A bigram that occurs nowhere in the scope is not required while its characters are covered by other bigrams. An atom that no term can cover stays uncovered, so every page is then a partial match.
Pages are ordered by these keys:
- Complete matches hide partial ones. A page covered within one section, together with the page’s own fields, leads a page that needs several sections.
- Strength. Each atom takes the strongest match found for it: title 10, keywords 8, tags and categories 6, headings 5, description 3, body 1; a loose match counts 0.7 of its field. Strength is the weighted mean over atoms, multiplied by 1.5 when the pieces are adjacent and in order, and by the page’s
search_boost. - The BM25 score of the best section, multiplied by
search_boost. - Title, then URL.
Strength depends on where the query was found and never on how often. Repetition therefore reorders pages only within equal strength.
Partial matches are ordered by coverage in tenths, then by the same keys. They keep the matched/total label. A word counts once in it, and a CJK run counts by pairs of characters.
BM25 runs per section with k1 1.2 and b 0.5 over section length in
characters. Occurrences are weighted by field, scaled by match quality, and
capped at 24 per field. A bigram of a run of n characters weighs
n / (2(n − 1)), because the run holds about n/2 words.
Each page still occupies one row and opens its best section.
Excerpts and highlights
The excerpt is the 160-character passage of the best section that shows the most different matches. A result carries the strings that were found, so an inflection or a corrected spelling is highlighted as written in the page. A word is not highlighted inside another word unless it could match there. Normalized matches still map back to the original text.
Stage 2: staged loading
The index template still writes every document with its body. What Hugo publishes depends on the size of that output:
| Index size | Published files | Page text |
|---|---|---|
| Up to 2 MiB | offline-search-index.<lang>.json, byte for byte as before |
Inside the index |
| Above 2 MiB, text up to 8 MiB | The index without body, and offline-search-body.<lang>.json |
Fetched by itself after the index, then added to the results |
| Text above 8 MiB, or Save-Data | The same two files | Fetched when the reader chooses “Search page text”, which shows its size |
2 MiB is the existing raw budget of one index, so a site within the budget
sees no change. The split index holds everything that locates a page: titles,
headings with anchors and byte offsets, keywords, taxonomies, descriptions.
The body file is a list of {ref, body} entries. Both names are fingerprinted
in production.
The palette requests the index on the first search keystroke, as before, and shows its results at once. While the text loads, the status line says so, and an empty result is reported as loading, not as no results. When the text arrives the engine is created again and the reader’s selected row is kept. A failed download offers the same row to retry. Opening the palette alone still requests nothing.
No key is added. offline_search_index remains a manual reduction, and a
summary, heading or title index has no body to move. A site template
that overrides assets/json/offline-search-index.json is split the same way.
The byte budget applies to the index that is fetched first.
Stage 3: searchable entries
Parameters and functions are usually defined in lists, not headings, so the
index could not target them. It now records search entries beside headings:
any rendered element with an id and a non-empty data-td-search-entry
title.
Every anchored field is an entry, from the fields shortcode and from a
{.fields} table. Nothing has to be configured or rewritten. A site can mark
its own elements the same way, from a shortcode or with a block attribute.
Entries join sections in document order with the same id, title and
start, so the index format and the engine are unchanged. The page text is
divided among headings and entries in that order. A section that holds
entries keeps only the text before the first one, and text inside an entry
opens that entry. headings still lists headings only.
field accepts id, so a reference page can keep an established anchor such
as guc-work-mem instead of field-work_mem. An unusable value, or one
another field already uses, warns and keeps the generated anchor. An id that
equals a heading’s is not detected, as with any explicit id.
An entry carries no kind. Nothing displays or filters by one yet, and the
field can be added to sections later without breaking a reader.
A database backend later
A later design may add a search provider backed by PostgreSQL. This proposal keeps two things open for it. The index file is complete enough to import as a corpus. The engine returns plain result rows through one call, which a remote provider can also produce once the palette awaits results. Nothing here adds a network request.
Compatibility and migration
Configuration and front matter keys do not change, and an index within 2 MiB keeps its fields. Indexes written by earlier releases still load.
- The theme no longer ships or loads Lunr, and
window.lunris undefined on OINK pages. A site that used the theme’s copy must load its own. OinkSearchEngine.createtakes(documents, maxResults). The Lunr argument is gone.- Results add
marksandstrength. The scale ofscoreandtextScorechanged. - A term no longer matches inside a short word. Queries that relied on
portfindingsupportreturn fewer pages. - A contiguous phrase is a multiplier, not a tier. A large
search_boostcan outrank it. - A CJK run no longer has to occur whole. Results that were empty may now be complete or partial matches.
- An index above 2 MiB has no
bodyin its documents. A tool that read page text from the index must readoffline-search-body.<lang>.jsonand join it byref. - The dialog gains
data-td-body-srcanddata-td-body-byteswhen the index is split.offline-search-index.htmlstill returns the index URL. - Two strings are added to every locale:
ui_search_body_loadandui_search_body_loading. - Rendered fields gain
data-td-search-entry, and an index holds one moresectionsitem per field. A section that contains fields no longer answers for text inside them; that text opens the field.
Implementation and checks
| Owner | Check |
|---|---|
| Theme | tests/js/search-engine.test.js for analysis, matching, ranking, excerpts and the published Porter examples; check-search.py for the built index and ranking on it |
| Theme | check-palette.py, check-navigation-contract.py and check-runtime-isolation.py assert that no page loads Lunr |
| Theme | check-vendor.py after removing the Lunr artifact, license and tree entry |
| Theme | check-search.py builds a probe above 2 MiB: one language is split, the other is not, section offsets address the separated text, and the dialog names the file and its size |
| Theme | tests/js/command-palette.test.js for results before the text, the loading state, the reader’s request, Save-Data, and retry after a failed download; check-i18n.py for the two strings |
| Theme | check-search.py for field and custom entries on the built index: order, titles, offsets, skipped invalid entries and their warning, and opening a field by name; check-content-primitives.py for the id parameter and its fallbacks |
| Site | tests/search/queries.json with scripts/check-search-corpus.mjs, which can time an older engine with --baseline-engine and --baseline-lunr |
| Site | Palette browser tests for composition, scope, partial state and keyboard use |
User guides and the license table have been updated for v1.6.0 alongside the normative contracts.
Acceptance and open decisions
The stages are accepted for OINK v1.6.0: the theme checks, real-corpus checks in
both summary and content scopes, and the documentation site’s check and
browser targets pass against them. This site’s index is within the 2 MiB
budget, so stage 2 is exercised by the theme’s probe and unit tests and by
larger consumer corpora.
Open decisions (deferred beyond v1.6.0):
- Are the weights right? Field worth, the loose factor, the phrase multiplier, and
bcome from a 48-query set and one large manual, not from labeled relevance. - Should partial matches follow complete ones when few pages are complete?
- Should
offline_searchdefault to on? Nearly every maintained consumer sets it. - Should Traditional and Simplified Chinese fold together?
- Do Arabic and Hebrew prefixes need a rule of their own?
- Is 8 MiB the right limit for loading page text unasked? It is a first choice, not a measured one.
- Should an entry carry a kind, and should a result show it?
Decision log
- 2026-11-23: Accepted all three stages for OINK v1.6.0; promoted behavior into the Shell and Components contracts and updated user guides and license inventory.
- 2026-11-23: Drafted. Chose scanning over an inverted index after measuring 1–8 ms per term over 12 MB of text. Chose bigrams over
Intl.Segmenter, which split数据库连接池超时into six fragments and varies by browser, and over a dictionary, whose 5 MB cannot ship with a theme. Rejected segmenting the query against the site’s own text after it proved unstable. - 2026-11-23: Implemented stage 3. An entry is one more item of
sections, so neither the index format nor the engine changed. The marker is an attribute any markup can carry; fields set it themselves. The plannedkindwas left out because nothing would read it. - 2026-11-23: Implemented stage 2. The split happens at the existing 2 MiB budget, so compliant sites publish the same bytes. The index template stays the only author of documents, because five consumer sites override it; the split is derived from its output. Page text is not requested when the palette opens, which keeps the rule that commands never cost a download.
- 2026-11-23: Implemented stage 1 in the theme’s working tree. Ranking moved from the weakest field needed to a weighted mean of field strengths after a curated query regressed. A phrase became a multiplier after it lifted low-scoring research pages over the canonical one.
3 - Media convergence
The theme’s main branch implements M1 (the shared media-result contract)
and M2 (Landing resource metadata). M3 is resolved as option 2.
Only native Markdown images support processing. The full fig source form
remains a container. Its parameter list deliberately excludes command/options.
M4 (compatibility retirement) remains open until consumers are inventoried.
The sections below retain the original design record.
Current baseline
The content image hook, numbered fig, cards, and galleries resolve local page
resources, section resources, global assets, static files, and explicit remote
URLs through content/image-resolve.html. Raster resources can supply intrinsic
dimensions and processed derivatives. data-td-image-zoom marks HTML Zoom
eligibility, and the build-time detector checks only this theme-emitted marker.
Standalone Markdown images can combine a caption or Book numbering with
processing and a link. Numbered image figures share td-figure and
td-book-figure semantics. Landing media uses the shared URL trust policy,
while featured images deliberately use a ranking resolver because they select
a representative image rather than render one explicit source.
Remaining problem
The shared safety boundary is stronger than the shared media model. Landing
media does not obtain the same page-resource metadata and processing
result as body images. Featured-image selection and explicit image resolution
return different result shapes, some compatibility class names remain in
markup, and Book’s full fig form cannot express every processing option that
the native image hook supports.
The design question is therefore no longer “replace seven image entry points,” but whether the remaining surfaces can share a small result contract without erasing their different semantics.
Goals and non-goals
Goals:
- define one normalized media-result shape for URL, source URL, dimensions, alternative text, attribution, processability, and external status;
- let explicit content images, Landing media, and representative images reuse that shape where their source semantics overlap;
- keep figure markup and Zoom eligibility single-owned;
- decide whether the full
figform needs processing or whether authors should use the native image form for processed numbered images; - retire compatibility markup only after consumer evidence and a release note.
Non-goals:
- adding a third-party lightbox or remote image service;
- changing image Zoom from opt-in to site policy by accident;
- giving galleries a new caption, sequence, or carousel model;
- merging non-image Book targets such as tables, equations, and examples into an image-only base class;
- making featured-image ranking identical to explicit image resolution.
Proposed phases
M1 — Result contract
Document the fields that the content and representative-image resolvers return, then extract their shared fields into one internal media-result contract. Source ranking stays in the featured resolver and source resolution in the content resolver. This internal refactor must preserve output bytes.
M2 — Landing resource metadata
Allow Landing items to resolve eligible local resources through the media contract, gaining intrinsic dimensions and the shared URL/security decision. Explicit width and height in Landing data retain precedence. Remote and static sources remain valid without claiming metadata for a processable resource.
M3 — Full figure capability decision
Choose one of two answers:
- add processing arguments to the full
figsource form and normalize them through the same processing helper; or - keep processing exclusively on native Markdown images and document full
figas the container for arbitrary numbered block content.
No implementation should leave both options half-supported. In both forms, Markdown/LLMS must consistently link to the documented source or derivative.
M4 — Compatibility retirement
Before removing old image-element classes or attributes, inventory downstream CSS and JavaScript. If a compatibility name is still used, retain it for a documented release window. Alternatively, migrate the owning site in the same release.
Safety, output, and accessibility
- Image URLs keep the shared scheme and remote-host policy.
- Missing required alternative text warns and renders a decorative fallback only where the current contract permits it.
- Width and height never claim metadata that an SVG, static file, or remote source did not provide.
- Linked images are not Zoom targets; the runtime preserves dialog focus, keyboard close, reduced motion, and narrow-screen containment.
- Print, Markdown, RSS, and LLMS strip interaction markers while retaining the intended image, caption, attribution, number, and link.
Acceptance criteria
For each phase, collect byte-level HTML and Markdown evidence. Run content and Landing resolver tests, URL/security checks, image-processing tests, and Book target checks. Run gallery/Zoom browser tests and real-site EN/ZH narrow-screen review. Acceptance requires an explicit M3 capability choice.
Open decisions
- Is one shared result struct enough, or would a common lower-level URL/resource record keep resolver ownership clearer?
- Should Landing consume resource attribution, or only dimensions and URL?
- Does full
figprocessing solve a real consumer need now that native images support numbering, captions, links, and processing together? - Which emitted compatibility names are still used by real consumers?
4 - Theme roadmap: the Sass exit and the next product stage
This page proposes an order of work and records the evidence behind it. R0 is accepted for OINK v1.6.0: the stylesheet is plain CSS that Hugo assembles, with no compiler and nothing generated in Git; see R0. Beyond that, the page defines no configuration key, output, or component. Every name below is provisional until its stage is accepted and moved to the owning contract.
| Record | Value |
|---|---|
| Status | R0 accepted for v1.6.0 (compiled-CSS delivery decided 2026-11-22, plain CSS verified 2026-11-23, Bootstrap JS removed 2026-11-23). R1–R3 remain draft and unaccepted |
| Owner | OINK maintainers |
| Date | 2026-11-21 |
| Scope | OINK theme and documentation site; the CLI only where a stage names it |
| Affected contracts | Architecture (toolchain, styles, outputs), Components, Shell, and customization guides |
| Source snapshot | Theme HEAD 49b5648 plus uncommitted work, documentation HEAD 3472785, local Hugo Extended 0.169.0 |
Recommendation
Make the next theme release about one thing: leaving LibSass without asking consumers to install Dart Sass. Hugo v0.170.0 removed LibSass and the extended edition. When this roadmap was drafted, OINK was pinned to 0.169.0, the last release that can build published v1.5.1, and its contract forbade the only upstream replacement. R0 shipped in OINK v1.6.0: the stylesheet is plain CSS, nothing compiles it, and no Hugo release is pinned.
After that, close what is half-built: first the small reader and author gaps that other frameworks treat as baseline, then version lifecycle, then a static API reference. Keep one content-model project active at a time, as the CLI roadmap already requires.
| Stage | Subject | Why in this position |
|---|---|---|
| R0 | Sass exit and the Hugo 0.170 baseline | Forced by upstream. It blocks every later upgrade |
| R1 | Small reader and author gaps | Low cost and frequent use. No new authority |
| R2 | Version lifecycle | Already the default next content capability. Upstream changed its premise |
| R3 | Static OpenAPI reference | API content is absent from search and agent outputs |
| Continuing | Agent output and engineering quality | Finishes existing work. Adds no service |
Context and evidence
Hugo 0.170 removes LibSass
Hugo v0.170.0, published on 2026-11-13, states that the extended edition is gone and that Dart Sass is the only transpiler. Setting transpiler to libsass returns an error. hugo.IsExtended always returns false, and module.hugoVersion.extended is deprecated and does nothing. Sass users must install Dart Sass separately.
Published v1.5.1 compiles two stylesheets through toCSS with the built-in compiler: scss/main.scss in head-css.html and scss/redoc.scss in scripts.html. The toolchain contract says that ordinary consumers must not install Dart Sass or another Sass executable, and that later changes must preserve that boundary. For v1.5.1, both statements cannot hold on Hugo 0.170.
According to the survey below, Docsy 0.17.0 and Doks 2.0 chose to require Dart Sass. This review did not build OINK on Hugo 0.170.
What the theme styles depend on
Measured on the theme checkout on 2026-11-21:
| Fact | Value |
|---|---|
| Theme-owned SCSS | About 16,600 lines under assets/scss/ |
Distinct --td-* custom properties |
185 |
| Sass variable references | 147, to 55 variables |
| Mixin calls | 50, of which 39 are Bootstrap media-breakpoint-* |
@extend rules |
15 |
| Bootstrap | 5.3.8. The full SCSS is imported, and bootstrap.bundle.js is loaded for dropdowns |
At that date the theme already expressed most of its design through custom properties. Its remaining Sass use was narrow, but Bootstrap’s palette was still computed by Sass at compile time.
Two local trials set the boundary of the options below:
- Dart Sass 1.105.2 did not compile the SCSS source of that date. It stopped at the nested
@import 'chroma/dark'in_chroma.scssand reported that every@importrule is deprecated and will be removed in Dart Sass 3.0.0. Changing the transpiler would therefore also have required source changes. - On Hugo 0.169.0, with neither Node nor Sass on
PATH,css.Buildbundled@import, expandedhugo:varsinto:rootcustom properties, lowered native nesting for the given browser targets, and preserved@layer. Hugo alone can therefore bundle plain CSS.
How consumers use the SCSS hooks
bin/update-consumers.py inventories 51 primary checkouts, 45 of them on v1.5.1. Their hook files were measured on 2026-11-21:
| Measure | Checkouts |
|---|---|
Carry a non-empty _styles_project.scss |
46 of 51 |
Use no mixin, @extend, control rule, or Sass variable in it |
38 of 46 |
Use // comments |
44 of 46 |
| Use nested rules | 40 of 46 |
Use &-suffix selector concatenation |
16 of 46 |
| Call a mixin | 6 of 46 |
| Set Sass variables in a variables hook | 18 of 51 |
The style hooks total about 26,000 lines; the largest has 1,893. None calls a Sass color function. The variables hooks mostly set $primary, $secondary, the four status colors, $line-height-base, and font families.
Most hook content is plain CSS written with Sass comments and nesting. It is still not valid CSS: // comments and &-suffix concatenation need a mechanical conversion. Eight files need real Sass semantics. Any Sass exit that ignores these hooks breaks nearly every consumer.
A later check found a second dependency. pgsty.com, pigsty.cc and pigsty.io compiled seven SCSS entries in their own templates that imported the theme’s partials directly.
What other frameworks ship
| Capability | Seen in | OINK today |
|---|---|---|
Per-page Markdown, llms.txt, full-text bundles, page actions |
Mintlify, Fumadocs, Rspress, Docsy 0.15 (experimental) | Shipped, with NAVJSON and an agent-docs scorecard in CI |
Nested or per-section llms.txt for large sites |
Mintlify, Fern | One index per language; full text per top-level section |
| Blocks shown only to people or only to agents | Mintlify, GitBook | None |
| Copyable prompt block | Mintlify, GitBook | None |
| Page status badge in navigation | Material for MkDocs, Starlight | None |
| Inserted, deleted, and focused lines in code | Expressive Code, Fumadocs, VitePress | None; fences have title, copy, wrap, collapse, and line options |
| Glossary with hover definitions | Material for MkDocs, Mintlify | None |
| Dismissible site announcement | Material for MkDocs, Hextra, Fumadocs | None |
| Related pages | Mintlify | Backlinks only |
| Visible fallback for a missing translation | Starlight | The language switch targets the language home page |
| Version switch that stays on the equivalent page; outdated banner | Mintlify, Docusaurus | Docsy-style version menu and archived-version banner |
| One searchable page per API operation | Mintlify, Fumadocs, Scalar | Swagger UI or ReDoc embed; other outputs link to the specification |
| Output with no inline script | Relearn 9 | Inline startup scripts; the deployment guide explains hashes and nonces |
The Hugo statements above were read from the release page and function reference, and the two trials were run locally. The other rows come from a survey of each project’s own documentation and changelog on 2026-11-21. They were read through a summarizing tool and not checked row by row, so confirm a row again before a stage depends on it.
Hugo itself added relevant capabilities since v0.153.0: a site matrix of languages, versions, and roles, with sites.complements to lend existing pages to another site without writing new output. Content adapters can generate pages from local data. R1 to R3 below must evaluate these before freezing a format.
What already works
As of OINK v1.7.0, the theme has 30 shortcodes (29 when drafted), 22 Landing sections, Book publication, Duo View, visual presets, static backlinks, and local search with mixed CJK and Latin terms. Its static agent outputs are more complete than most open-source frameworks in the survey. Community issues mostly ask for correctness and reading comfort, not for more component families. R1 therefore concentrates on those gaps.
Goals and non-goals
Goals:
- build OINK with a current Hugo release and no other executable;
- give every existing consumer a tested migration path for its style hooks;
- close baseline reader and author gaps with static, semantic output;
- complete version lifecycle and API reference so their content reaches search, Print, Markdown, and agent outputs;
- keep every theme-owned network feature off by default.
Non-goals:
- requiring Dart Sass, Node, or the OINK CLI for an ordinary build;
- a hosted assistant, MCP server, analytics backend, or signed-in content;
- a visual editor or a new reading shell;
- type-aware code hover, page narration, or an API testing platform;
- interactive graph views (G2/G3) before the stages above ship.
R0: the Sass exit
Options
| Option | What a consumer needs | Assessment |
|---|---|---|
| A. Require Dart Sass | A second executable on every machine, CI job, and container | Rejected by the current dependency contract |
| B. Stay on Hugo 0.169.0 | Nothing | Not durable. No later upstream fix can be adopted |
| C. Publish compiled CSS; customize with custom properties and plain CSS | Hugo only | Chosen on 2026-11-22 and delivered first |
| D. Rewrite the theme source as plain CSS before anything else | Hugo only | Same consumer result as C. Doing it first would have delayed the upgrade, so it followed C as the next step and removed the maintainer-side compiler |
Decision and delivered design
On 2026-11-22 the owner chose option C: ship compiled CSS, retire the SCSS hooks, and adjust the sites that compiled theme SCSS themselves. That first delivery kept SCSS as the source and committed the compiled bundles, so a maintainer still needed LibSass. The source was then converted to plain CSS, which is option D taken as the next step, and the compiler was removed. Both steps are accepted for OINK v1.6.0. The contract is Plain CSS stylesheet delivery.
| Item | State |
|---|---|
| Stylesheet source | Done. Plain CSS layer files under assets/css/td/, listed in cascade order by layouts/_partials/css/layers.html. assets/scss/, the vendored SCSS, the compiled bundles under assets/oink/ and bin/build-css.py are deleted. Nothing generated is kept in Git |
| Consumer build | Done. css/bundle.html concatenates the layers with resources.Concat; templates call no compiler and there is no build step. The stylesheet is not passed through css.Build: it needs no bundling, and css.Build would have to treat every font URL as external |
| Site layer | Done. assets/css/project.css and assets/css/project/*.css, plain CSS, published as one stylesheet after the theme’s. Hugo minifies it and does not transform it |
| Sass variables | Done differently from the draft. No token derivation was added. A site restates the values its variables produced as plain overrides in project.css. In the theme, values that were Sass variables are written out in the layers |
| Site-owned shells | Added. A layout asks css/bundle.html for chrome, landing, search or compare by name. These replace the SCSS partials that pgsty.com, pigsty.cc and pigsty.io compiled in their own templates |
| Compiler | Closed. There is no compiler, for a site or for a maintainer, so the question of replacing LibSass with Dart Sass no longer arises |
| Hugo 0.170 baseline | Site builds verified on Hugo 0.170.1 on 2026-11-22 with only the Hugo binary, and again on 2026-11-23 after the conversion. No Hugo release is pinned: checks use the installed one, CI installs the current one, and any edition works. theme.toml and hugo.yaml still declare 0.169.0 as the minimum |
| Owning checker | bin/check-stylesheets.py replaces bin/check-scss.py |
| Bootstrap reduction | Script done, styles open. The theme no longer loads Bootstrap’s JavaScript; see the 2026-11-23 entry below. Reducing the styles is not part of this delivery. Each Bootstrap component is now its own layer file under assets/css/td/bootstrap/ |
Neither step changed how pages look. After the first delivery, for a site
without style hooks, the production stylesheet equaled the previous one except
for whitespace inside one @starting-style block. The conversion to plain CSS
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, but no rule or declaration changed.
Compatibility and migration
The three SCSS hooks were public surface, so retiring them is a breaking
change. This release ships as v1.6.0 on the v1 module path
(github.com/pgsty/oink) with the breaking changes documented upfront in the
changelog and upgrade guide.
- Hooks are converted by hand; the upgrade guide lists the steps. A site’s rules now load after the theme, so they beat later theme rules of equal specificity, most visibly the visual presets. A converted site is therefore compared page by page.
- A one-time converter was written during this delivery and then removed, together with the Sass override layer it compiled through, so the theme keeps no legacy Sass path. Before its removal, on 2026-11-22, a dry run over the 46 inventoried hook files reported no failed check, and each of the 51 inventoried checkouts was copied, converted where it still had hooks, and built against the new theme on Hugo 0.170.1 with only the Hugo binary: 50 built, 55,020 pages in all, with no stylesheet warning. The remaining one, pgsty.com, timed out fetching its own remote report manifest in that harness and built completely in a separate run.
- pgsty.com, pigsty.cc and pigsty.io were adjusted by hand. After the first delivery, on 2026-11-22, their rebuilt stylesheets reproduced every declaration of the old compiled ones, and four of the seven were byte-identical after minification. They now ask for the smaller stylesheets by name.
- Classic
themes/oinkconsumers and vendored copies follow the same path and are reviewed separately, as the release process already requires. - The theme no longer contains SCSS that a site could compile for itself. A site that wants to change Bootstrap overrides the corresponding custom properties and rules in its project stylesheet. The theme does not invoke a compiler and keeps no legacy Sass path.
The remaining consumers convert when they adopt the release. Until then a site that still carries hooks builds with a warning and the theme’s default styles.
R1: small reader and author gaps
Each item is independent, opt-in where it adds markup, static in HTML, expanded in Print, and plain text in Markdown and agent outputs. Names are provisional.
| Item | Proposed behavior | Main constraint |
|---|---|---|
| Page status | A front matter value such as new, beta, or deprecated marks the sidebar row and article header |
Closed vocabulary, 32 locales. NAVJSON v1 is a closed schema and stays unchanged |
| Line markers in fences | Fence attributes mark inserted, deleted, and focused lines | Attributes, not in-source comments, so Copy still returns authored source |
| Glossary | One data file per language defines terms; an explicit reference renders a definition on hover and focus, and a glossary page is generated | No automatic scan of page text in the first stage |
| Announcement | One site-level notice, dismissible, shown again when its text changes | Visible without JavaScript; absent from Print, Markdown, and feeds |
| Related pages | A page-end group from Hugo’s related-content index, or an explicit front matter list | Sits beside backlinks without a second navigation authority |
| Missing-translation fallback | A language may show the source-language page with a visible notice | Never silent. The page declares its real language and canonical URL |
| Not-found suggestions | The 404 page suggests near matches from the local search index | Only when local search is enabled. No network |
| Sortable tables | An author marker adds column sorting to the table reader | Not a default; authored order stays in other outputs |
Related pages cover most of what a local graph view would add. G2 and G3 in the knowledge-graph proposal therefore stay deferred.
R2: version lifecycle
The CLI roadmap keeps the detailed draft. This roadmap adds one requirement: before the manifest format is frozen, evaluate Hugo’s native version dimension against independent per-version builds.
The evaluation must answer:
- Can a version dimension coexist with the existing
params.versionsmenu and external archives? - What do build time and output size cost for several versions in two or more languages?
- Does the native dimension give page correspondence without a separate logical key?
- How are canonical URLs, search indexes, and agent bundles scoped to one version?
- Which new schema version carries version identity, given that
NAVJSONv1 is closed?
Reader-side targets are unchanged from the CLI roadmap and gain two from the survey: switching version stays on the equivalent page, and an outdated or unreleased version says so on every page.
R3: static OpenAPI reference
Swagger UI and ReDoc render only in HTML. Print, Markdown, and feeds receive a link to the specification, and operations never reach local search or agent bundles. The accessibility suite excludes both embeds.
The CLI roadmap proposes a generator that writes Markdown. Before choosing, compare it with a Hugo content adapter that generates one page per operation from a local specification at build time. An adapter needs no CLI and no generated source in Git, but must resolve references and cycles in templates. Choose with a real specification, not a toy one.
Either way, the result is ordinary pages in the existing output pipeline. Interactive requests stay out of the first increment. If added later, credentials live only in session storage and no proxy is used.
Continuing work
Agent output
| Item | Proposed behavior |
|---|---|
Sectioned llms.txt |
A large site splits its index by section so each file stays within the size check |
| Audience markers | A block attribute keeps content in HTML only or in Markdown and agent outputs only, decided at build time |
| Prompt block | A fence renders a copyable prompt and reuses existing page actions |
| Discovery files | An opt-in experiment publishes a site-authored skill file and its well-known index. The conventions are still changing |
| Content negotiation | Documented server recipes for Accept: text/markdown. Static hosting cannot do this, so it is a guide and not a theme feature |
A hosted MCP server and a built-in assistant stay out of scope. The existing search-tail extension lets a site connect its own.
Engineering quality
- Strict CSP. Move stable inline initializers to same-origin files with data configuration, and publish a hash manifest for what must stay inline. This closes F10.
- Engine matrix. Run the core shell, navigation, content, and dialog suites on Firefox and WebKit, and publish a support matrix. This closes F11.
- Navigation feel. Run the Speculation Rules experiment the performance rules already describe on one named production consumer, together with cross-document view transitions as a CSS-only enhancement.
- Freshness. Optional review date, owner, and expiry in front matter, shown in the page annotation and reported by the CLI. A modification date is never presented as verification.
- Social cards. Build-time images need a site-supplied font for CJK titles, so this comes last.
Sequencing
| Order | Delivery | Exit evidence |
|---|---|---|
| 1 | R0 compiled CSS delivery, since superseded by the plain CSS source in row 3 | Done on Hugo 0.169.0 and 0.170.1 with no Sass executable on PATH: theme checkers, the documentation site’s checks and browser suite, and a file-by-file comparison of the regression fixture |
| 2 | R0 migration tool, run dry on the 51 inventoried checkouts | Done, then removed: every hook file converted, with no failed declaration check and one site to review. The tool was deleted with the Sass override layer it needed; hooks are now converted by hand |
| 3 | R0 plain CSS source, accepted for v1.6.0 | Done on 2026-11-23 with Hugo 0.170.1: the production main stylesheet is byte-identical to the last one compiled from Sass, and the regression fixture is identical apart from the stylesheet path. No compiler and no generated file remain |
| 4 | OINK v1.6.0 release and consumer adoption | Tag v1.6.0 verified on Go proxy; consumers upgrade pins and build with Hugo alone |
| 5 | R1 items, each on its own | Owning checker, goldens for every output, bilingual contract |
| 6 | R2 evaluation, then one accepted design | Two real repositories use it before compatibility promises |
| 7 | R3 comparison, then one accepted design | A real specification is fully accounted for |
Agent-output and quality items fit between stages when they do not compete with the active one. Bootstrap reduction was cut from R0. Its script has since been removed; reducing its styles stays open.
Implementation and owning checkers
| Stage | Theme owner | Site and CLI |
|---|---|---|
| R0 | check-stylesheets.py owns the layers and their assembly; check-presets.py and check-font-tokens.py |
Browser, appearance, and visual review in EN/ZH |
| R1 | check-shell.py, check-components.py, check-code-blocks.py, check-goldens.py, check-i18n.py, check-params.py |
Content, keyboard, and accessibility suites; guides in both languages |
| R2 | check-shell.py, check-navigation-contract.py, check-agent-indexes.py; a new navigation schema version |
CLI inspection and correspondence checks |
| R3 | check-output.py, check-components.py, check-search.py |
Real-specification fixture; accessibility with no embed exclusion |
Each stage moves its accepted behavior to the owning contract in both languages and then leaves this page.
Acceptance criteria
- R0: an unmodified consumer renders the same pages on Hugo 0.170.1 or later with only Hugo installed; the stylesheet checker fails when the layer lists and the layer files disagree or a layout calls a compiler; the upgrade guide tells a site how to convert its hooks.
- R1: each item has HTML, Print, Markdown, and RSS behavior covered by goldens, strings in all 32 locales, and keyboard, forced-colors, RTL, and narrow-screen review.
- R2 and R3: a named real consumer, a bilingual contract accepted before any compatibility promise, and no second navigation or Markdown authority.
- Every stage: ordinary
hugo serverstays usable with invalid input, and a normal build downloads nothing.
Open decisions
- Resolved on 2026-11-23: ship as
v1.6.0on thev1Go module path (github.com/pgsty/oink) with deliberate breaking changes documented inCHANGELOG.mdand the upgrade guide, keeping module paths stable for existing consumers. - Closed: the theme source is plain CSS, verified on 2026-11-23. There is no maintainer build, so no Dart Sass release has to be chosen and its 11 selector changes do not arise.
- Resolved on 2026-11-22: no legacy path for sites that install Dart Sass themselves.
- Resolved for now: brand and semantic colors are custom properties in site CSS. A configuration key remains possible later.
- Is the page-status vocabulary closed?
- Is glossary linking ever automatic?
- Do line markers drop out of Markdown output or become a diff fence?
- Does version lifecycle use Hugo’s native dimension or independent builds?
- Is the API reference generated by a content adapter or by the CLI?
- Which production consumer measures Speculation Rules?
Decision log and sources
- 2026-11-21: Drafted from a review of the theme, its active proposals and community issues, a survey of other frameworks, and local trials of Dart Sass and
css.Build. - 2026-11-22: The owner decided on compiled CSS delivery, retirement of the SCSS hooks, and hand adjustment of the three sites that compiled theme SCSS. Implemented on the theme’s main branch with the documentation site and those three sites; not committed, tagged, or deployed. The R0 design section now records what was built, which differs from the draft in three places: no
css.Build, no token derivation, and bundles for site-owned shells. - 2026-11-22: Verified on Hugo 0.170.1 after upgrading the local Hugo. With only the Hugo binary on
PATH, the theme checkers pass, the regression fixture’s 686 output files match the previous pipeline apart from the main stylesheet, the documentation site passes its checks and 546 browser tests, and 50 of 51 consumer checkouts build after conversion. Published v1.5.1 fails on that Hugo because it needs Dart Sass. At that point the maintainer-side compiler was still the LibSass in Hugo Extended 0.169.0. - 2026-11-23: The stylesheet source is plain CSS, assembled by Hugo from the layer files under
assets/css/td/.assets/scss/, the vendored SCSS of Bootstrap, Font Awesome, Inter and IBM Plex Sans, the compiled bundles underassets/oink/,bin/build-css.pyand the CI job that recompiled the bundles are deleted.bin/check-stylesheets.pyreplacesbin/check-scss.py, and stylesheets are published under/css/instead of/scss/. Verified with Hugo 0.170.1: the productionmainstylesheet is byte-identical (556,437 bytes) to the last one compiled from Sass, and the regression fixture’s 683 output files are identical apart from the stylesheet path. The maintainer-compiler question is closed because there is no compiler. No Hugo release is pinned. On the theme’s main branch; no tag contains it. - 2026-11-23: The theme no longer loads or vendors Bootstrap’s JavaScript, and Popper went with it. Only two controls used the script: the version menu of the bottom bar and the phone drawer, and the Landing
downloadchannels. The first is now the hover popover the navbar version menu already was, placed by CSS; the second switches in the Landing runtime. Both keep their markup classes and look. The core script every page loads,js/core.js, went from 92,443 to 8,740 bytes minified. A site that uses a Bootstrap script component in its own markup must load the script itself; none of the 48 inventoried module consumers does. On the theme’s main branch working tree; no tag contains it. - 2026-11-27: Removed the sentence “add no new component family” from the summary and from R1’s rationale. It had been drafted by an agent and never decided by the owner. New content components proceed under their own proposals.
Sources read on 2026-11-21:
5 - Content components expansion: review and shared design
All six components ship in OINK v1.7.0, are documented in the component guides, and are governed by the Components contract. This proposal is preserved as design rationale.
| Record | Value |
|---|---|
| Status | Accepted and shipped in OINK v1.7.0 (implemented 2026-11-27) |
| Owner | OINK maintainers |
| Scope | OINK theme; this documentation site; one optional oink-cli helper (separate proposal) |
| Affected contracts | Components, Architecture, the component guides, configuration reference |
| Evidence snapshot | Theme 9738dcf, site b749ba4, Hugo 0.170.1, local consumer checkouts under ~/www and ~/pgsty |
The six proposals
| Component | Final form | New public API | Runtime | Proposal |
|---|---|---|---|---|
| Timeline | Definition list + {.timeline} |
None (author marker) | None | Timeline component |
| Update | Heading + {.update date="…" tags="…"} |
Two heading attributes | None | Update component |
| Social posts | > [!SOCIAL] callout + block attributes (a shortcode in v1.7.0) |
One callout type | None | Social post component |
| Video |  and platform URLs |
Media attributes on the image hook; params.video_embeds |
Shared media.js for file players and enabled embeds |
Video component |
| Audio |  |
Media attributes on the image hook | Shared media.js for file players |
Audio component |
| Map | map data fence |
One fence; params.map |
Vendored Leaflet, only when enabled | Map component |
The documented component catalog grows from 21 to 27. In v1.7.0 the shortcode count
grew from 29 to 30 (social); the later callout form returns it to 29. The image and
heading render hooks gain branches, and one fence hook (map) is added.
Review verdict
All six components close real gaps, and the first draft understood OINK’s infrastructure well. Its weakness was shape: it gave nearly every component a new shortcode, a long parameter list, and a runtime. Taken together that was 7 new shortcodes, about a hundred parameters, fields, and configuration keys, 3 new runtime chunks, and 16 locale keys. The final design has one new shortcode, about 35 parameters and keys (most of them existing figure and fence attributes), one small chunk plus one vendored engine, and six locale keys. The accepted Markdown-first decision requires a proposal to show first why Markdown plus an existing hook is insufficient. Applied to each component, that test removes most of the surface:
| Draft element | Final decision | Main reason |
|---|---|---|
timeline + event shortcodes, .timeline list marker |
Definition list + {.timeline} only |
A timeline is marker/event pairs; Markdown already has pairs |
{{%/* update */%}} with seven parameters and a sticky rail |
.update heading marker with date and tags |
A heading already carries outline, anchor, search, and Print IDs; the rail duplicates the TOC |
x with metrics, verified badges, image lists, quote parameters, data files, and an author registry |
social with six parameters and a Markdown body |
Images, galleries, and quoted posts compose from existing syntax; snapshots rot |
video shortcode with about twenty parameters |
Image syntax for video files and platform URLs | The image hook already resolves, captions, numbers, and degrades media; it drops .mp4 today |
audio shortcode with chapters, speed, mutex, and transcript body |
Image syntax; transcripts use a folded callout | Native controls cover playback; single-active playback ships in shared media.js for 2+ players, while chapters wait for evidence |
map fence plus single-point shortcode, named styles, CARTO default |
One fence; no default tile provider | One form; the theme must not choose a commercial tile service for every site |
New file-resolve.html copying the image lookup order |
Extract the existing lookup and share it | One lookup order, not two |
The review also found two facts the draft could not have known without probes:
- Overriding Hugo’s built-in
xwith a shortcode that takes a body turns the legacy unclosed form{{</* x user="…" id="…" */>}}into a build failure (shortcode "x" must be closed or self-closed, Hugo 0.170.1). A template warning cannot run first. The owner then renamed the componentsocial, which leaves Hugo’sxuntouched. See Social posts. Image.Exifwas removed in Hugo 0.155.Image.Metareturns GPS coordinates only when the site’simaging.meta.fieldsincludes GPS, which Hugo’s defaults exclude. Photo auto-pinning therefore needs a site-level opt-in. See Map.
Evidence
| Probe or survey | Result | Used by |
|---|---|---|
Definition list followed by {.timeline} |
Goldmark emits <dl class="timeline">; a definition keeps several paragraphs |
Timeline |
Heading with {.update date="2026-11-23" tags="Breaking, Performance"} |
render-heading receives class, date, and tags; the TOC shows only the heading text |
Update |
 and  in a page bundle |
The image hook receives IsBlock, attributes, and resources typed video/mp4 and audio/mpeg |
Video, Audio |
Current content/image-resolve.html |
A non-image resource warns and is dropped | Video, Audio |
| Percent shortcode that emits a Markdown heading | The heading enters .TableOfContents |
Update alternatives |
Built-in x overridden by a body-taking template |
Unclosed legacy calls fail to parse | Social posts (the rename) |
Image.Meta on a JPEG with GPS EXIF |
Coordinates only after enabling GPS fields in imaging.meta.fields |
Map |
| Leaflet on npm, 2026-11-27 | latest 1.9.4; 2.0 in beta (beta.5, 2026-11-19) |
Map |
Consumer Markdown under ~/www and ~/pgsty |
No use of Hugo’s x, tweet, youtube, or vimeo shortcodes; raw Bilibili <iframe> embeds on two blogs; raw <video>; autoplay loop muted GIF replacements pointing at expiring signed URLs |
Social posts, Video |
The probes ran against a minimal Hugo site with OINK’s required Goldmark settings. They confirm Hugo behavior, not OINK output. Each implementation stage repeats them as fixtures.
Shared design rules
Authoring entry points
Every component uses an entry point that already exists or one new, narrowly justified one:
| Entry point | Today | Gains |
|---|---|---|
| Goldmark block attributes on lists | .steps, .cards, .filetree |
.timeline on a definition list |
| Heading render hook | id, class pass-through |
.update with date and tags |
| Image render hook | Images, figures, Book numbering, Zoom, Draw.io candidates | Video files, audio files, recognized video platform URLs |
| Data fence | gallery, filetree, echarts, … |
map |
| Blockquote alert hook | Callout types, fold markers, {icon=} |
[!SOCIAL] with avatar, date, url, platform (the v1.7.0 social shortcode, revised) |
No component adds a percent-delimited shortcode. steps remains the only one.
Resource lookup
Video, audio, posters, subtitle tracks, post avatars, and map thumbnails all need
the lookup that content/image-resolve.html performs today: page bundle,
branch bundle, global assets/, then static/ or an explicit HTTP(S) URL. The
implementation extracts that lookup into one partial that both the image
resolver and a media resolver call. The image resolver keeps its image-only
rules (processing, alt metadata, byline). Image output must stay byte-identical
across the refactor; the existing goldens prove it.
Remote URLs are never fetched at build time. A remote media URL is the author’s explicit choice, as it is for images today.
Network policy
The architecture contract requires network-capable features to be explicitly and completely configured. Two of the six components have such features:
| Feature | Default | Enabled by | Incomplete configuration |
|---|---|---|---|
| Video platform players | Static link card; no third-party request | params.video_embeds: [youtube, bilibili, vimeo] (any subset) |
Unknown names warn and are ignored |
| Map tiles | Place list with coordinate links | params.map.enable plus tiles and attribution |
Warns and stays off, as Draw.io does without a server |
Neither feature has a theme-chosen default provider. Timeline, Update, Social posts, and local or object-storage media need no configuration.
Runtime budget
| Component | HTML runtime | Loaded when |
|---|---|---|
| Timeline, Update, Social posts | None | — |
| Video or Audio | js/chunks/media.js |
Page has a file player or an enabled platform card |
| Map | content-components.js adapter plus vendored Leaflet and its CSS |
params.map is complete and the page has a map |
Markdown, Print, and RSS set none of these flags.
Styles, accessibility, and locales
New rules live in plain CSS layer files under assets/css/td/, listed in
layouts/_partials/css/layers.html before rtl, the presets, accessibility,
and print. They use --td-* tokens, logical properties, and preset geometry
(flat Ink and Terminal surfaces), and cover forced colors, reduced motion,
narrow screens, long tokens, and print. Author markers (.timeline, .update)
stay unprefixed; generated classes use td-.
The six components together add six locale keys (Social posts: one; Video:
two; Map: three, with its zoom buttons reusing the diagram keys), in all 32 locale
files with native translations, checked by bin/check-i18n.py.
Answers to the first draft’s questions
| Question | Answer |
|---|---|
Default tiles once params.map.enable is true |
None. As with Draw.io, maps stay off until tiles and attribution are set (Map) |
| TOC text when an update has both a label and a title | The heading text; there is no separate label or title (Update) |
| When to extract GPS coordinates from photos | A later stage after explicit coordinates, as a site imaging.meta opt-in (Map) |
| Bilibili comment overlay | Off (danmaku=0), with no option in S4 (Video) |
| Book numbering for video and map | Video accepts num natively as a figure; a map is wrapped in fig, like other diagram fences; audio is not numbered (Audio) |
Delivery order
| Stage | Scope | Why here |
|---|---|---|
| S1 | Timeline and Update | CSS plus one heading-hook branch; no runtime, no configuration |
| S2 | Video and Audio files, shared lookup extraction, media.js for autoplay |
Highest observed use; replaces raw <video> and GIFs |
| S3 | Social posts | One shortcode, one locale key |
| S4 | Video platform cards and opt-in players (params.video_embeds) |
Third-party iframes; needs CSP and privacy review |
| S5 | Map: vendored Leaflet, params.map, the fence |
The only new vendored engine |
| Later | Map photo pins from GPS metadata; audio chapters; oink fetch social |
Each waits for its own evidence |
Each stage ships with fixtures under tests/site/, intentional golden updates,
EN/ZH guides under /docs/components/, contract updates, and browser review on
this site. Stages are independent; a later one can be dropped without
reworking an earlier one.
Open decisions
- Acceptance and release (resolved). All six components ship in OINK v1.7.0; normative behavior now lives in the Components contract.
- Demo media in Git. The guides’ video and audio demos add about 600 KB of binary files to this site’s repository. Keep them in the page bundles, or move them to object storage and reference them by HTTPS URL, which the media form supports.
Decision log
- 2026-11-27 (first draft). Requirements and architecture for six
components in one page:
timeline/event,{{%/* update */%}}, offlinexwith aplatformenum,audio,video, and opt-in OpenStreetMapmap. - 2026-11-27 (review). Split into six proposals plus this overview. Reduced
the public surface to one shortcode (
x), one fence (map), and branches in the image and heading hooks. Recorded the probe evidence above, thexparse finding, the EXIF configuration requirement, and the roadmap conflict. - 2026-11-27 (owner). Renamed the offline post component
socialso it no longer conflicts with Hugo’sx. Removed the theme roadmap’s “add no new component family” sentence, which had never been an owner decision; the roadmap conflict section of this page went with it. - 2026-11-27 (implementation and acceptance). All six components were
implemented on
mainwith fixtures, goldens, invalid-input cases, and runtime unit tests, accepted for OINK v1.7.0, and documented with guides and demos on this site. Deviations from the drafts are recorded in each component’s decision log. - 2026-11-28 (owner). Applied the Markdown-first test to Social posts as
well: the shortcode becomes the
> [!SOCIAL]callout, so no component in this set needs a new shortcode. See the Social post decision log.
6 - Timeline component
Shipped in OINK v1.7.0, documented in the Timeline guide, and governed by the Components contract. Shared decisions are in the overview.
| Record | Value |
|---|---|
| Status | Accepted and shipped in OINK v1.7.0 (implemented 2026-11-27) |
| Owner | OINK maintainers |
| Delivery stage | S1, with Update |
| Form | Native: a Markdown definition list followed by {.timeline} |
| New public API | The author marker .timeline; no shortcode, attribute, or configuration key |
| Runtime | None |
| Affected surface | Component contract, a new stylesheet layer, a new guide at /docs/components/timeline/ |
Summary
A timeline is a sequence of pairs: a marker (a date, a time, a version, “Day 2”)
and what happened. Markdown already has a construct for pairs, the definition
list. OINK styles a definition list marked {.timeline} as a vertical axis
with a marker column and an event column. Nothing else is added.
Problem
Prose pages often narrate events in order: incident postmortems, project
milestones, a product’s history, a conference agenda, a biography. Authors
write these today as bullet lists with a bold date, as tables, as steps
(whose generated numbers misstate the meaning), or as raw HTML. None of them
shows time as a visual axis, and none has a stable structure.
The visual grammar already exists. The Landing timeline section
(layouts/_partials/landing/sections/timeline.html) renders date, title, and
description on an axis, but only from Landing data on a landing page. Prose
cannot reach it.
Design principles
- The structure is a pair. Each entry has exactly one kind of marker and a
body. A definition list encodes that directly (
<dt>/<dd>); a bullet list with a bold first word only imitates it. - Native first. The Markdown-first decision
prefers a native form when Goldmark can keep the meaning. It can: Goldmark
attaches the class to the
<dl>, and a definition keeps full block content. - The marker is free text. “2024-05”, “09:02”, “v1.6.0”, “Day 2”, and “Q3 2026” are all valid. The component does not parse dates, so it never rejects a real-world marker.
- One visual grammar. The prose timeline uses the same axis, node, and marker-column vocabulary as the Landing section, expressed with article tokens.
Goals and non-goals
Goals
- A readable chronological axis in HTML from ordinary Markdown.
- Rich event bodies: paragraphs, lists, code, images, callouts.
- Identical meaning in Print, RSS, Markdown, and LLMS, with no new output branch.
- Zero JavaScript and zero configuration.
Non-goals
- A
timeline/eventshortcode pair, per-event icons, tones, badges, or links as parameters. - Date parsing, sorting, grouping by year, or relative times (“3 days ago”).
- Horizontal, zoomable, or Gantt-style timelines (Mermaid already offers Gantt and timeline diagrams for schedules).
- Entries in the page outline; that is the Update component.
- Replacing the Landing
timelinesection orsteps.
Proposed behavior
Authoring
- Each term (a line without a leading colon) is a marker. Terms are inline Markdown on one line; plain text is recommended.
- Each definition (
: …) is an event body. Continuation paragraphs, lists, and fences are indented as for any definition. - A marker may have several definitions; they render as consecutive events under one marker.
{.timeline}sits on the line directly after the last definition, with no blank line. As with every Goldmark block attribute, a blank line detaches it and the marker is silently lost; the guide states this next to the example.- The conventional event title is a leading bold phrase. It is a writing convention, not syntax.
The native form requires Goldmark definition lists
(markup.goldmark.extensions.definitionList), which Hugo enables by default.
The component contract’s prerequisite list gains this line.
Rendering
Goldmark produces the markup; the theme adds only CSS, scoped to
.td-content dl.timeline so a site’s unrelated .timeline rules do not
collide:
| Condition | Layout |
|---|---|
| Wide column | Two-column grid: a marker column sized to its content and capped (about 10rem), and an event column. An axis line runs along the start edge of the event column, with a node on each marker row |
| Narrow column | One column: marker above body, axis and nodes on the start edge |
| Ink, Terminal | Flat surfaces; square nodes (0px in Ink, 2px radius in Terminal); preset --td-meta-font-family (Inter sans-serif in Ink, IBM Plex Mono in Terminal) with tabular numerals |
| Forced colors | Axis and nodes use system colors; no meaning carried by color |
| Axis as a thin border; no backgrounds; short entries avoid page breaks inside | |
| RTL | Logical properties mirror the axis |
| Long tokens | Markers wrap rather than widen the column |
Outputs
| Output | Result |
|---|---|
| HTML | <dl class="timeline"> from Goldmark, styled by the theme; no runtime |
| The same markup with print rules | |
| Markdown / LLMS | The authored source (native forms keep source) |
| RSS | The <dl> as rendered; feed readers show terms and definitions |
Accessibility
Screen readers announce a definition list with term/definition pairs in source order. Markers are text, so nothing depends on the axis graphics, which are decorative pseudo-elements.
Trade-offs and alternatives
| Option | Decision | Reason |
|---|---|---|
First-draft timeline + event shortcodes with time, title, badge, icon, tone, link |
Rejected for the first stage | Two shortcodes and a parent/child collector for decoration, not a missing capability. A plain-text title parameter is weaker than a Markdown body, and the Markdown output would have to be synthesized |
Bullet list with a bold date and {.timeline} |
Rejected | The marker is not structurally separate; CSS would depend on li > p:first-child > strong:first-child and break when an item starts differently |
A steps variant |
Rejected | Steps generate numbers; a timeline marker is authored text |
| Reusing the Landing section through a data file | Rejected for prose | A data file per timeline moves prose out of the page. The visual tokens are shared instead |
<ol> semantics |
Not chosen | An ordered list announces order but not the marker/body pair. Order is still the source order in a <dl> |
Costs of the chosen form:
- Definition-list syntax is less familiar than bullets. The guide leads with a copyable example.
- GitHub and some editors do not render definition lists. The source still
reads as a marker line followed by
: eventlines. - Per-event decoration is out of reach. If evidence shows it is needed, a later proposal can add a full form; the native form stays the primary one.
Compatibility
Purely additive. The theme gives .timeline no meaning today. A local consumer
scan found one site stylesheet using .timeline, scoped under its own
application class, so the scoped theme selector does not collide with it.
Implementation plan
- Add a stylesheet layer (for example
assets/css/td/timeline.css) and list it inlayouts/_partials/css/layers.htmlbefore the RTL, preset, accessibility, and print layers. - Add a fixture page to
tests/site/covering single and multiple definitions per marker, rich bodies, a marker with long tokens, and an RTL page; record HTML, Print, Markdown, and RSS goldens withbin/check-goldens.py --update. - Owning checks:
bin/check-stylesheets.py,bin/check-goldens.py, andhugo --source tests/site --printPathWarnings. - Update the bilingual component contract (native form and prerequisite) and add EN/ZH guides with the cheatsheet row.
- Review on this site: four presets, light and dark, desktop and mobile, RTL, forced colors, and browser print.
Acceptance criteria
- A definition list with
{.timeline}renders the axis layout with no template change and no runtime. - Markdown and LLMS outputs equal the authored source.
- A definition list without the marker renders exactly as before.
- Reviews pass for all presets, both color schemes, narrow screens, RTL, forced colors, and print.
Open decisions
- Marker column width. Recommended: content-sized with a cap. A fixed width, as on the Landing section, aligns better but truncates “Q3 2026 – Q1 2027”.
- A compact modifier. Recommended: none in S1; add
{.timeline .td-timeline-compact}only if fixtures show a need. - Shared CSS with Landing. Recommended: share tokens and proportions, not selectors; the two contexts have different containers.
Decision log
- 2026-11-27 (first draft).
timeline/eventshortcodes plus a.timelinelist marker. - 2026-11-27 (review). Native definition list only; shortcodes, icons, tones, and badges removed from the first stage.
- 2026-11-27 (implementation). Implemented as specified:
assets/css/td/timeline.css(a content-sized marker column capped byfit-content(10rem)), the.timelineauthor marker registered inbin/check-namespace.py, and thetimeline-updatefixture with HTML, Markdown and Print goldens.
7 - Update component
Shipped in OINK v1.7.0, documented in the Update guide, and governed by the Components contract. Shared decisions are in the overview.
| Record | Value |
|---|---|
| Status | Accepted and shipped in OINK v1.7.0 (implemented 2026-11-27) |
| Owner | OINK maintainers |
| Delivery stage | S1, with Timeline |
| Form | Native: a Markdown heading with {.update date="…" tags="…"} |
| New public API | The author marker .update and two heading attributes, date and tags |
| Runtime | None |
| Affected surface | layouts/_markup/render-heading.html, component contract, a stylesheet layer, a new guide at /docs/components/update/ |
Summary
An update entry is a heading. Marking it .update adds a metadata line with a
machine-readable date and neutral tag chips, and gives the entry its visual
rhythm. Because the entry is still an ordinary heading, it joins the TOC,
keeps its self-link, keyboard heading navigation, and search section, and is
namespaced in multi-page Print — all with no new mechanism.
Problem
Single-page changelogs, “What’s new” pages, weekly notes, and policy-change
logs are a sequence of dated sections. Authors write them today as headings
followed by an ad-hoc date line and badges. The date has no <time>
semantics, every site invents its own layout, and badges written inside a
heading leak into the TOC and anchor.
Mintlify’s <Update> shows the demand. OINK already has layout: releases,
but it serves a different case: one content page per GitHub release, with its
own URL, feed item, and assets. A product that wants one readable stream on
one page has no component.
Design principles
- An entry is a heading. Membership in the outline is the essential property; everything that already works for headings must keep working.
- Native first. The heading hook already receives block attributes; the
probe confirmed
class,date, andtagsarrive intact and the TOC shows only the heading text. - The page is the authority. An update page is the source of truth for its own entries. A version that already has a release page is not described a second time here, following the rule that facts stay outside presentation strings.
- Do not compete with the TOC. The docs shell already shows the outline with scroll tracking in the right rail.
Goals and non-goals
Goals
- Dated, tagged entries from ordinary Markdown headings.
- Unchanged TOC, anchors, self-links, keyboard navigation, search sections, Print namespacing, and footnotes.
- Identical meaning in Print, RSS, Markdown, and LLMS.
- Zero JavaScript and zero configuration.
Non-goals
- A
{{%/* update */%}}shortcode, a container, or a two-column sticky rail. - Separate
labelandtitlefields, alevelparameter, or alinkparameter; the heading text, heading level, and body already express them. - Tag color vocabularies (for example “breaking” → red).
- Per-entry URLs, feed items, or GitHub release binding; those belong to
layout: releases. - Generating entries from data, sorting, or filtering.
Proposed behavior
Authoring
| Attribute | Rule | Invalid input |
|---|---|---|
.update |
Author marker on any heading level; usually ## for entries |
— |
date |
Optional. String YYYY, YYYY-MM, or valid calendar YYYY-MM-DD |
Non-string or invalid calendar date warns and drops the date; the entry and valid tags stay |
tags |
Optional. String of , or , separated plain text; items are trimmed, empty items skipped |
Non-string warns and drops the tags |
id |
Existing heading rule; explicit #id recommended for version headings |
Existing behavior |
date and tags on a heading without .update warn and are dropped. That is
the heading hook’s existing rule for unsupported attributes, so no new
diagnostic path is needed. An entry without a date (for example “Unreleased”)
is valid.
The heading text is the entry’s label and title: ## v1.6.0,
## v1.6.0 — Plain CSS stylesheets, or ## 2026-11 weekly notes. Subsections
inside an entry are ordinary lower-level headings and nest under it in the TOC.
Rendering
The metadata line sits after the heading, not inside it, so heading text, the accessible name, the self-link, and the search section title stay clean. The date shows the authored ISO string, which already matches OINK’s default date format in every locale.
Styling, scoped to the article:
- An entry heading gets extra space above it and a separator rule, which give a long stream its rhythm.
- The date uses the metadata font with tabular numerals.
- Tags are neutral chips sharing badge geometry. Presets own their colors.
- Ink and Terminal keep flat, square geometry; forced colors use system colors; print drops backgrounds and keeps the separator.
Outputs
| Output | Result |
|---|---|
| HTML | Heading plus metadata line; no runtime |
| The same; multi-page Print namespaces the heading ID as for any heading | |
| Markdown / LLMS | The authored source, including the attribute block |
| RSS | Heading plus metadata line as static HTML |
Choosing between Update and release pages
| Need | Use |
|---|---|
| One readable stream on one page | .update headings |
| One page per version, its own URL and feed item, release assets, GitHub binding | layout: releases |
| A short dated sequence inside other prose | Timeline |
Trade-offs and alternatives
| Option | Decision | Reason |
|---|---|---|
First-draft {{%/* update label date title tags level id link */%}} with a sticky two-column rail |
Rejected | It works in Hugo (a percent shortcode that emits a heading does enter the TOC), but seven parameters re-encode what heading syntax already says; the label must be escaped into generated Markdown; the Markdown output must be synthesized; and it would be the second percent shortcode after steps |
| The sticky rail itself | Rejected | In the docs shell the left navigation, right TOC, and a rail would leave about 38rem for code and tables, and the rail repeats what the TOC already tracks. A per-entry wrapper is also required for position: sticky, so the rail forces the shortcode |
One {{%/* updates */%}} container with headings inside |
Rejected | Sticky children share one containing block and pile up; a grid cannot make a heading span its section. The visual gain does not justify a container |
A front-matter page mode that turns every ## into an entry |
Deferred | Implicit; mixes introduction headings with entries. Revisit only if pages show the explicit marker is tedious |
| Keyword-to-color tag mapping | Rejected | A hidden English vocabulary that never matches Chinese tags, and colored chips compete with presets |
| Badges inside the heading text | Rejected | They leak into the TOC, anchors, and search titles |
Costs of the chosen form:
- No Mintlify-style rail. The look is a clean entry stream, not a clone.
- Attribute syntax on headings is less discoverable than a named shortcode; the guide and the cheatsheet lead with it.
- The Markdown output keeps
{.update …}on the heading line. Agents read it easily; it is the same trade-off every native form makes. render-heading.htmlruns for every heading on every page, so the new branch must stay cheap: test for theupdateclass before any other work.
Compatibility
Additive. A heading without .update renders byte-identically. Today date and
tags on a heading already warn and are dropped, so no existing page can
depend on them.
Implementation plan
- In
render-heading.html, when the validated class list containsupdate, allowdateandtags, validate them, and emit the metadata line after the heading. - Add a stylesheet layer (or a section of an existing content layer) and list
it in
layers.html. - Fixtures: entries with and without dates, invalid dates, tags with
whitespace and empty items, nested subsections, an entry inside a multi-page
Print section, and a heading with
datebut no marker. Record HTML, Print, Markdown, and RSS goldens. - Owning checks:
bin/check-content-primitives.py(attribute policy),bin/check-output.py,bin/check-goldens.py,bin/check-stylesheets.py. Confirmsearch/sections.htmlkeeps the heading text as the section title. - Update the bilingual component contract and add EN/ZH guides with the cheatsheet row.
Acceptance criteria
- TOC entries, anchors, keyboard heading jumps, and search sections are unchanged by the marker.
<time datetime>appears only for valid dates; invalid input warns and keeps the entry.- Headings without the marker are byte-identical to the current output.
- Multi-page Print namespaces update headings like any other heading.
- Preset, color-scheme, narrow-screen, RTL, forced-colors, and print reviews pass.
Open decisions
- Visual weight. Recommended: separator and metadata line only. A start-edge axis per entry would need a wrapper and is deferred.
- Date in the TOC. Recommended: no; the TOC stays compact and authors can put a date in the heading text when it is the label.
- Locale key for tags. Recommended: none; tag chips carry no extra label. If an accessible group name proves necessary, reuse the existing taxonomy label.
Decision log
- 2026-11-27 (first draft). Percent-delimited
updateshortcode with a sticky rail and seven parameters. - 2026-11-27 (review). Replaced by the
.updateheading marker withdateandtags; rail, tone mapping, and per-entry links removed. - 2026-11-27 (implementation). Implemented in
render-heading.htmlandassets/css/td/timeline.css. Headings without the marker stay byte-identical (the theme goldens prove it); invalid input is covered bycheck_update_headingsinbin/check-content-primitives.py. No locale key was needed. - 2026-11-27 (post-review hardening). Extracted styles to
assets/css/td/update.css; added visually hidden,separators inside.td-update-metato fix search-index, RSS, screen-reader, and copy token gluing; addedrich-copy.jssupport; fixed dark-mode print contrast (--td-print-*) andh2.updatebottom-border sandwich; replaced negative margin with:has(+ .td-update-meta)and tightened first-entry /h2+h3.updatespacing; aligned Ink top border and tag surface; addedif not .Attributesfast path,printf "%T"string type guards, real calendar date checks viatime.AsTime, and full-width,tag splitting. - 2026-11-27 (acceptance review). Firefox still copied the tags glued (
FixDocs) and WebKit put each comma on its own line, because flex items are blockified anduser-select: noneremoved the separators from the selection. The metadata line is now inline flow with<span class="td-update-sep">, </span>separators atfont-size: 0, and all three engines copy2026-11-23, Fix, Docs. Theif not .Attributesfast path never ran, since Goldmark gives every heading anid; it now applies when that id is the only attribute, roughly halving the heading hook’s template time on the documentation site with byte-identical output. The fixture goldens record the separator markup and the new word count.
8 - Audio component
Shipped in OINK v1.7.0, documented in the Audio guide, and governed by the Components contract. Shared decisions are in the overview.
| Record | Value |
|---|---|
| Status | Accepted and shipped in OINK v1.7.0 (implemented 2026-11-27) |
| Owner | OINK maintainers |
| Delivery stage | S2, with video files |
| Form | Native: a block Markdown image whose destination is an audio file |
| New public API | None beyond accepting audio destinations; attributes caption, id, and preload |
| Runtime | Shared js/chunks/media.js for the control row and single-active playback |
| Affected surface | The media partial shared with Video, a stylesheet section, a new guide at /docs/components/audio/ |
Summary
An audio file renders as a figure: the bracket text as a visible title, the
browser’s native <audio controls>, and an optional caption. The transcript,
show notes, or lyrics are ordinary content after it; a folded callout keeps
them out of the way in HTML and expanded in Print.
Problem
Podcast episodes, text-to-speech and voice-model samples, pronunciation guides,
music excerpts, and recorded talks need a player inside prose. Today
 warns and drops, and raw <audio> has no title, caption,
Print, or RSS form. A bare player tells the reader nothing about what it plays.
Design principles
- Same syntax and branch as video. One media partial owns detection, lookup, and static outputs for both.
- The name is visible. A video shows its picture; audio has none, so the bracket text doubles as the visible title and the player’s accessible name.
- The page owns the controls; the browser owns playback. The native
<audio controls>is the no-JavaScript player. With the runtime, one theme control row with a single seek bar replaces it in every browser (revised 2026-11-28; the native strip first stood as the player). - Compose, don’t absorb. A transcript is content, and OINK already has a folded container that prints expanded. The component does not grow a body.
Goals and non-goals
Goals
- Local, bundle, global-asset,
static/, and object-storage audio files. - A visible, accessible title; an optional caption.
- Static Print, RSS, Markdown, and LLMS forms with a usable link.
- Native playback works without JavaScript. The shared runtime draws the control row and pauses other audible players.
Non-goals
- An
audioshortcode or a transcript body inside the component. - Hand-typed metadata that can drift from the file:
duration,artist. - Codec fallbacks (
mp3=,ogg=,m4a=). - In the first stage: cover art, chapters, waveforms.
- Podcast feeds or RSS
<enclosure>elements; podcast distribution is a site concern.
Proposed behavior
Detection
A block image is audio when its destination ends in mp3, m4a, aac,
oga, ogg, opus, wav, or flac in any letter case (a page or global
resource, a static/ path, or an HTTPS URL), or is a resource whose Hugo
media type is audio/*. Hugo defines no audio/* type by default, so the
media type only matters when a site declares one. Resolved local resources
preserve query strings and fragments (such as Media Fragments #t=30,60) with
their percent-encoding as written. An inline
audio destination renders as a plain link.
Attributes
| Attribute | Rule |
|---|---|
caption |
Plain text below the title, linked via aria-describedby |
id |
Validated like other figure IDs; an ID that another unnumbered audio or video figure or a numbered Book target already uses warns and is dropped from whichever comes second. Heading and plain image IDs are not compared |
preload |
metadata or none; defaults to metadata for the first 6 audio players on a page and none from the 7th onward |
num, poster, autoplay, track, width, height, link, command,
and options warn and are dropped. Book numbering is left out because
OINK’s numbered kinds are figures, tables, equations, and examples; calling a
recording a figure would mislabel it. An empty bracket text warns and the file
name becomes the title.
Rendering
Audio is always a figure (without .td-figure, so its header stays
start-aligned), because it always has a visible title. The player spans the
reading width; consecutive audio figures and an immediately following
.td-callout--details transcript use :has() positive margins so each
audio-transcript pair groups tighter than adjacent pairs: 8px between a
recording and its transcript, 16px between consecutive recordings, and the
ordinary media margins, 1.5rem above and 1.75rem below, around each group
(:where(.td-media):not(.td-figure), one class of weight above Bootstrap’s
figure reset). Presets style the
frame and title (the card takes --td-code-radius like callouts; Paper and Ink align its surface with adjacent callouts;
Terminal uses --td-brand-line-strong and --td-ui-font-family); the control
row follows the preset and color mode in every browser (see
Components), and the
no-JavaScript native player keeps the browser’s look.
preload="metadata" lets the browser show the duration without downloading
the file; switching the default to preload="none" from the seventh audio
player onward prevents connection bursts on long sample pages.
Outputs
| Output | Result |
|---|---|
| HTML | <audio controls>, replaced by the theme control row from js/chunks/media.js |
Title, caption, and the file URL as a visible .td-media__link on screen and paper (paper-palette overrides in @media print) |
|
| Markdown / LLMS | The authored source; a following transcript callout stays readable text |
| RSS | Title as a direct link to the file (absolute URL) and the caption |
| Rich copy | Start-aligned figure preserving title, caption, and clickable URL link |
The callout hook already renders folded callouts as static, expanded blocks in
dedicated Print and RSS, and Markdown keeps their source. A transcript written
as > [!DETAILS]- is therefore complete in every static output without any
audio-specific rule.
Large files
The Video guidance applies: prefer object storage for long recordings; page-bundle audio is committed to Git.
Trade-offs and alternatives
| Option | Decision | Reason |
|---|---|---|
First-draft {{</* audio */>}} with src, mp3, ogg, m4a, title, artist, cover, duration, chapters, caption, preload, loop, download, compact, and a transcript body |
Rejected | Codec fallbacks are obsolete, duration and artist are facts that drift from the file, cover and compact create two layouts, and the body duplicates a folded callout |
| A runtime for a speed toggle and chapters | Speed adopted 2026-11-28; chapters deferred | The theme control row cycles speed in every browser; chapters need WebVTT evidence before growing the UI. The shared media script handles single-active playback |
| Hidden bracket text, as for images | Rejected | A bare player is unlabeled for sighted readers |
| Numbering as a Book figure | Rejected | A recording is not a figure; a numbered audio kind would need its own Book index, which nothing requests |
Costs of the chosen form: no podcast-style card with cover art, and the player looks slightly different in each browser. Both are acceptable for a first stage whose job is to make audio publishable at all.
Later candidates
Each needs its own evidence and adds to js/chunks/media.js, which video
already introduces:
- Chapters: from a WebVTT
chapterstrack (the standard carrier) rather than a parameter mini-language. - Cover art:
posteron audio, if podcast pages ask for it.
Compatibility
Additive; today an audio destination warns and renders nothing.
Implementation plan
Audio lands with video files in S2 and reuses the same lookup extraction, media partial, and fixtures. Specific work:
- Audio detection, the figure layout, and static outputs in
content/media.html. - Fixtures: each source kind, an empty bracket text, an unsupported attribute, inline audio, consecutive samples, and a transcript callout in each output.
- Owning checks:
check-media-primitives.py,check-output.py,check-output-security.py,check-goldens.py,check-stylesheets.py,tests/js/media.test.js,tests/js/rich-copy.test.js, andtests/browser/audio.spec.mjs. No locale key is needed. - EN/ZH guide and cheatsheet row; contract update.
Acceptance criteria
- A single player shows elapsed time in the page accent. Starting a second audible player pauses the first.
- Each audio figure has a visible title and an accessible name via
aria-labelledby(plusaria-describedbywhen captioned). - Print, RSS, Markdown, and LLMS contain no
<audio>element and keep a usable link (visible on screen and paper in Print; linked title in RSS). - A following
> [!DETAILS]-transcript is expanded in dedicated Print and pairs tightly with its player on screen.
Open decisions
- Title placement. Resolved: above the player, start-aligned.
- Single-active playback in S2. Resolved: the same runtime handles progress for every file player and coordinates multiple audible players.
Decision log
- 2026-11-27 (first draft).
audioshortcode with chapters, speed control, mutex runtime, cover, duration, and transcript body. - 2026-11-27 (review). Native image syntax with
captionandid; transcripts composed from a folded callout; runtime features deferred. - 2026-11-27 (implementation). Implemented in the shared media partial and
assets/css/td/media.css; no runtime and no locale key. Two invalid-input cases were added tobin/check-media-primitives.py. - 2026-11-27 (review revision). Addressed deep-review findings: dedicated Print now uses visible
.td-media__link;@media printresets audio cards to paper-palette tokens in dark mode; removed.td-figurefrom audio and enforced start alignment; switched<audio>accessible naming toaria-labelledby/aria-describedby(withrender-block.htmlID rewriting); preserved query strings and#t=Media Fragments on local resources; replaced negative margins with:has()positive margins for consecutive cards and Audio+Transcript pairing; aligned Paper and Terminal frame/title styling; preserved audio URL and start alignment inrich-copy.js; addedpreloadattribute with 6-player auto-threshold (nonefrom 7th onward); added unnumbered duplicate#iddetection and accurateaudio:warning prefix; enabled single-active playback injs/chunks/media.jsonly when 2+ players exist on a page; added nested<a>guard incheck-output.py, expandedcheck-media-primitives.py, JS unit tests, andtests/browser/audio.spec.mjs. - 2026-11-27 (adversarial review fixes). Restored the 24px/28px margins that
:where(.td-media)had lost to Bootstrap’sfigure { margin: 0 0 1rem }(now:where(.td-media):not(.td-figure)), so the 8px/24px pairing holds; single-active playback now treats any muted or zero-volume player as silent and also reacts tovolumechange, so unmuting a playing loop pauses other audio and an author’s own muted loop is left alone;book/register-target.htmlchecks unnumbered media IDs, making the duplicate-ID check two-way; local fragments keep their percent-encoding (EscapedFragment);preloadwarns only in HTML; the audio card takes--td-code-radiusin every preset and Ink’s callout surface. The browser suite asserts absolute spacing and uses realplay();check_audio_matrix()covers upper-case extensions, a site-definedaudio/*media type, encoded fragments, Book-target ID clashes in both orders, and a subpathbaseURL. - 2026-11-28 (control row). The owner judged the native strip plus the theme’s separate accent strip as two progress bars and asked for one bar that tells played and loaded time apart by color, styled per preset. Firefox and Safari do not expose their native track, so
js/chunks/media.jsnow removescontrolsand draws one control row (play, time, a single seek bar, speed, mute and volume) with eightui_media_*labels in all 32 locales; the native player remains the no-JavaScript fallback. Played, buffered and unloaded time keep at least 3:1 between played and each neutral in every preset and mode.
9 - Video component
Shipped in OINK v1.7.0, documented in the Video guide, and governed by the Components contract. Shared decisions are in the overview.
| Record | Value |
|---|---|
| Status | Accepted and shipped in OINK v1.7.0 (implemented 2026-11-27) |
| Owner | OINK maintainers |
| Delivery stages | S2 (files, autoplay), S4 (platform cards and players) |
| Form | Native: a block Markdown image whose destination is a video file or a recognized video-platform URL |
| New public API | Image attributes poster, track, autoplay for video; configuration params.video_embeds |
| Runtime | Shared js/chunks/media.js for file players and enabled platform cards |
| Affected surface | render-image.html, the shared resource lookup, a media partial, a stylesheet layer, the configuration schema, a new guide at /docs/components/video/ |
Summary
Video uses the syntax authors already use for images:
The image hook recognizes a video destination and hands it to a shared media
partial. A file becomes a native <video> with controls. autoplay=true turns
it into a muted, looping demo that plays only while visible and never under
reduced motion. A YouTube, Bilibili, or Vimeo URL becomes a static card that
links to the platform; when the site lists that platform in
params.video_embeds, clicking the card loads the platform’s player in place.
Problem
warns and drops today, because the image resolver accepts only image resources.- Authors fall back to raw
<video>with no caption, numbering, Print, or RSS form, and to raw<iframe>players that load third-party scripts and cookies on page view, shift the layout, fail where the platform is blocked, and rot when videos disappear. - Animated GIF demos are large and cannot be paused; the usual replacement is a
hand-written
autoplay loop mutedvideo that ignores reduced motion.
Evidence from local Markdown under ~/www and ~/pgsty (2026-11-27): two
blogs embed the same Bilibili <iframe> directly; a travel post uses raw
<video controls>; repository READMEs in the same corpus use autoplay loop muted videos whose URLs carry expiring signatures. No checkout uses Hugo’s
built-in youtube or vimeo shortcode.
Design principles
- A video is a figure. It has a source, an accessible name, an optional caption, and an optional Book number, exactly like an image. The image hook already owns all four, so video extends it instead of adding a shortcode.
- Precedent exists. GitLab Flavored Markdown renders image syntax that points at a video or audio file as a player, and Obsidian embeds YouTube videos written with image syntax. OINK’s own Draw.io component is a native image form.
- The URL is the identity. A platform URL is what readers, feeds, and agents understand, and it carries the start time. The theme derives player URLs from it at build time; nothing is fetched.
- No third-party request without consent. By default nothing leaves the page. With a site opt-in, the platform is contacted only after a reader clicks.
- Progressive enhancement. Every form works without JavaScript; the runtime replaces native file controls with the theme control row, coordinates audible players, gates autoplay on visibility, and opens enabled embeds in place.
Goals and non-goals
Goals
- Local, page-bundle, global-asset,
static/, and object-storage (HTTPS) video files. - Poster, one subtitle track, caption, Book numbering, and layout without shift when a size is known.
- A GIF replacement that is small, pausable, and respects reduced motion.
- YouTube, Bilibili, and Vimeo without third-party requests by default.
- Static, readable Print, RSS, Markdown, and LLMS forms.
Non-goals
- A
videoshortcode, or overriding Hugo’s built-inyoutubeandvimeo. - Codec fallbacks with several
<source>elements; MP4 (H.264) plays everywhere OINK supports. - Streaming (HLS/DASH), custom player chrome, playlists, chapters.
- Remote platform thumbnails, oEmbed, or any build-time request.
- Platforms beyond the three, or arbitrary iframe URLs.
Proposed behavior
Detection
A block image is a video when its destination is one of:
| Destination | Recognized by |
|---|---|
| Page, branch-bundle, or global resource | Hugo media type video/* |
static/ path or HTTPS URL |
Extension mp4, m4v, webm, ogv, or mov |
| Platform URL | A strict pattern below |
An inline image with a video destination renders as a plain link to the file or watch page, with the bracket text as link text. Anything else keeps today’s image behavior.
Attributes
| Attribute | Applies to | Rule |
|---|---|---|
caption, num, id |
All video | The shared figure contract; num registers a Book fig target |
poster |
All video | Image path through the shared image resolver. A local raster also supplies width/height |
track |
Files | One WebVTT file through the shared lookup. srclang is the page language; the label is the language name |
autoplay |
Files | true or false; see below. Warns and is ignored for platform URLs |
width, height |
All video | Positive integers; intrinsic size or aspect hint, overriding the poster’s |
link, command, and options warn and are dropped. The bracket text is the
accessible name. Without width/height or a local poster, the box reserves
16:9 until metadata loads.
Files
Unlike a block image, a video always renders inside a <figure>, with or
without caption or num.
autoplay=true emits muted loop playsinline and a data-td-media-autoplay
marker, but not the autoplay attribute. The runtime starts playback when at
least half of the video is visible, the page is visible, and the reader has not
asked for reduced motion; it pauses when the video leaves the viewport. The
control row stays, so the motion can always be paused. Without JavaScript the
reader sees the poster or first frame and plays it by hand.
Platform URLs
| Platform | Accepted URLs | Derived player |
|---|---|---|
| YouTube | youtube.com/watch?v=<id>, youtu.be/<id>, youtube.com/shorts/<id> with an 11-character ID; t or start |
https://www.youtube-nocookie.com/embed/<id>?start=…&autoplay=1 |
| Bilibili | bilibili.com/video/BV<id> or /video/av<number>; p and t |
https://player.bilibili.com/player.html?bvid=…&p=…&t=…&autoplay=1&danmaku=0 |
| Vimeo | vimeo.com/<number>, optionally /<hash> for unlisted videos |
https://player.vimeo.com/video/<number>?h=…&dnt=1&autoplay=1 |
IDs are validated against these patterns before any URL is built; author text
never enters a player URL. A b23.tv/BV… short link resolves to the player;
only an opaque short link that cannot be resolved offline, such as
b23.tv/abc, renders the card without a player and warns with the full-URL
form.
Default output is a card: the poster or a neutral surface, a play glyph, the bracket text, and the platform name, all inside one link to the canonical watch URL. No iframe, script, or thumbnail request.
With the platform listed in params.video_embeds, the card also carries the
derived player URL. On click, the runtime replaces the card with an iframe that
has the bracket text as title,
allow="autoplay; picture-in-picture; fullscreen",
sandbox="allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox",
allowfullscreen, and referrerpolicy="strict-origin-when-cross-origin", and
moves focus into it. Without JavaScript the link still opens the platform.
Configuration
A non-list warns and keeps cards only; unknown names warn and are ignored. A
list (rather than a boolean) lets a site enable Bilibili without YouTube when
part of its audience cannot reach YouTube. Sites with a Content Security Policy
add the enabled player hosts to frame-src; the guide lists them.
Outputs
| Output | Result |
|---|---|
| HTML | File players and enabled platform cards load the shared media.js |
Poster when present, caption and Book label, and the file or watch URL as visible text; no <video> or <iframe> |
|
| Markdown / LLMS | The authored source |
| RSS | Poster (absolute URL) when present and a link with the bracket text; no <video> or <iframe> |
Ordinary browser printing of HTML shows the poster or current frame; print rules reveal the URL beneath it.
Large files
A video in a page bundle is committed to Git. The guide recommends an
object-storage or CDN URL for anything beyond a few megabytes, in line with the
repository rules for binary assets. The theme does not measure file sizes at
build time; a size report belongs to oink-cli checks.
Trade-offs and alternatives
| Option | Decision | Reason |
|---|---|---|
First-draft {{</* video */>}} with src, youtube, bilibili, vimeo, webm, mp4, controls, muted, loop, gif, ratio, and more |
Rejected | About twenty parameters restate what image syntax and figure attributes already express, and a shortcode would be a second way to place video |
Overriding Hugo’s youtube and vimeo |
Rejected | Hugo’s vimeo can fetch from Vimeo at build time (its simple mode); each override widens divergence from Hugo (see the X parse finding); a URL is clearer than an ID |
gif=true that removes controls |
Renamed and changed | autoplay describes the behavior. Removing controls fails WCAG 2.2.2 (pause, stop, hide) |
The autoplay HTML attribute |
Rejected | It ignores reduced motion and keeps playing off-screen; the runtime gate is the accessible form |
| Remote platform thumbnails | Rejected | A third-party request on every view |
A boolean params.video_embeds |
Rejected | Reachability differs by platform and region |
Costs of the chosen form:
- Image syntax for video is a convention, not CommonMark semantics. Renderers other than GitLab show a broken image; the Markdown output keeps the URL, so agents still understand it.
- Discoverability shifts from a shortcode’s parameter list to the image guide; the cheatsheet gets its own Video row.
render-image.htmlgains a dispatch. The media branch lives in its own partial so the image path stays readable and its goldens unchanged.
Compatibility
Additive. A video destination produces a warning and no output today, so no
page depends on that behavior. Image output must stay byte-identical, which the
existing goldens verify. params.video_embeds is a new key.
Implementation plan
- Extract the lookup from
content/image-resolve.htmlinto a shared partial; image goldens must not change. - Add
content/media.html(detection, attributes, outputs) and dispatch to it fromrender-image.htmlbefore image-only work. - Add
assets/js/media.jsas the stable chunkjs/chunks/media.js, selected from a Page Store flag inscripts.html; unit tests undertests/js/with mockedIntersectionObserverandmatchMedia. - S4: platform patterns,
params.video_embedsinhugo.yaml,bin/check-params.py, and the generated configuration schema. - Locale keys in all 32 files:
ui_video_play(“Play video”) andui_video_open(“Open on the video site”), checked bybin/check-i18n.py. - Fixtures: files from each source kind, poster with and without size,
subtitles, autoplay, inline video, each platform pattern, invalid IDs, short
links, and each output. Owning checks:
check-media-primitives.py(the image hook and shared resolution),check-runtime-isolation.py(the chunk flag),check-output.py,check-output-security.py,check-goldens.py,check-stylesheets.py,check-params.py,check-i18n.py,node --test. - Browser review on this site: keyboard, focus after the player loads, reduced motion, presets, mobile, and print.
Acceptance criteria
- Pages with only plain platform links omit the media runtime.
- With
video_embeds: [], the HTML contains no player host URL. - Autoplay never starts under
prefers-reduced-motion: reduceand pauses off-screen. - Print, RSS, Markdown, and LLMS contain no
<video>,<iframe>, or runtime marker. - Existing image goldens are byte-identical.
Open decisions
- Uncaptioned video (resolved). The shipped implementation always wraps
videos in
<figure class="td-media">for a uniform frame and consistent print and typeset-copy output. - Subtitles. Recommended: one
trackper page; each language page names its own file. A list form is deferred. - Bilibili comments. Recommended:
danmaku=0with no option in S4. - Unknown size. Recommended: reserve 16:9; vertical videos set
width/heightor a poster.
Decision log
- 2026-11-27 (first draft).
videoshortcode with source modes, about twenty parameters,gif=true, and opt-in facades. - 2026-11-27 (review). Moved to native image syntax with three media
attributes, an accessible autoplay gate, platform URLs as identity, and a
per-platform
params.video_embedslist. - 2026-11-27 (implementation). Implemented in
content/media-detect.html,content/media.html,content/video-embeds.html,assets/js/media.jsandassets/css/td/media.css, with the lookup extracted intocontent/resource-lookup.html. Differences from this draft: the configuration key is the flat listparams.video_embeds(the parameter contract flattens single-key maps); a video without caption or number keeps atd-mediawrapper without a figcaption; Print and RSS name the video beside its URL; the locale keys areui_video_playandui_video_open. Both network settings are validated on every page. Eight invalid-input cases were added tobin/check-media-primitives.py, andtests/js/media.test.jscovers the runtime. - 2026-11-27 (review hardening). Fixed decimal parsing for leading-zero timestamps (
08s,010), expanded platform URL parsing (youtube-nocookie.com,music.youtube.com,player.vimeo.com, Vimeo?h=and#t=, uppercaseAV,b23.tv/BV…, trailing slashes, and9:16default ratio for YouTube Shorts), decoupled poster image dimensions from pairedwidth/heightaspect ratios, replacedsetTimeout(0)autoplay event tracking with a FIFO expected-event queue, added iframesandboxand tightenedallowand the runtime player-URL regex, excluded.td-media-card__posterfrom Draw.io detection, fixed dark-mode play-button contrast, poster scrim contrast, narrow-screen card grid overlap, portrait80vhsymmetry, forced-colors styling, RTL play-icon alignment, and Print/RSS watch URLs (including browser print after iframe replacement). Added zero-binary media-type and video matrix checks inbin/check-media-primitives.py,video_embedsitem enum generation inbin/generate-config-schema.py, andtests/browser/video.spec.mjs. - 2026-11-27 (acceptance review fixes). Cards carry their ratio as
--td-media-ratioand cap their width atmin(100%, 80vh × ratio)(card and player), because WebKit does not narrow a box whoseaspect-ratioheightmax-block-sizeclamps; where container units exist the ratio is a minimum height measured from the figure, because WebKit also keeps anaspect-ratiobox at its ratio height and clipped wrapped titles. Browser print gives poster-less card text the paper ink in dark mode. Draw.io skips only images insidea.td-media-cardagain, leaving other linked diagrams editable. Bilibili’s embed-codesrc,player.bilibili.com/player.html?bvid=…|aid=…, is recognized instead of rendering as a remote image. Covered by the video matrix and a stylesheet contract inbin/check-media-primitives.py,tests/js/drawio.test.jsandtests/browser/video.spec.mjs. - 2026-11-28 (control row). File videos share audio’s theme control row: one seek bar whose colors tell played, buffered and unloaded time apart, speed, a captions toggle for the one track, mute and volume, and full screen on the figure with the row kept under the picture (iPhone falls back to the native player). Clicking the picture toggles playback. Native
controlsremain the no-JavaScript fallback.
10 - Map component
Shipped in OINK v1.7.0, documented in the Map guide, and governed by the Components contract. Shared decisions are in the overview.
| Record | Value |
|---|---|
| Status | Accepted and shipped in OINK v1.7.0 (implemented 2026-11-27) |
| Owner | OINK maintainers |
| Delivery stage | S5; photo pins from GPS metadata later |
| Form | Data fence: ```map with a YAML or JSON list of places |
| New public API | The map fence and its fields; configuration params.map |
| Runtime | None by default; vendored Leaflet through content-components.js when maps are enabled |
| Affected surface | layouts/_markup/render-codeblock-map.html, scripts.html, content-components.js, VENDOR.json, a stylesheet layer, the configuration schema, three locale keys, a new guide at /docs/components/map/ |
Summary
HTML, Print and RSS render a numbered list with names, notes, thumbnails and OpenStreetMap coordinate links. Markdown and LLMS preserve the authored fence. When a site enables maps and names its tile service, an interactive map with matching numbered markers appears above the list in HTML. Nothing is enabled, and no tile service is chosen, by default.
Problem
Travel writing, photo essays and Expo pages, event and office locations, field trips, and site visits need places on a map. Authors use screenshots (static, no links, stale), Google Maps iframes (API keys, billing, terms, regional blocking, third-party scripts), or nothing. OINK has no way to say “these places, in this order” that also survives Print, feeds, and agents.
Design principles
- The list is the content; the map enhances it. A reader without the map (Print, RSS, no JavaScript, a blocked tile host) gets the same places, in the same order, with working links.
- Network only after complete configuration. Tiles are third-party requests from the reader’s browser. As with Draw.io, the theme ships no default server and stays off until configured (architecture contract).
- The site chooses the tile service. Tile services have usage policies, quotas, keys, and attribution terms. A theme default would make that legal and operational choice for every site.
- One form. A fence holds one place as easily as twenty; there is no second shortcode.
- WGS 84 coordinates. The system used by GPS, photo metadata, and OpenStreetMap.
Goals and non-goals
Goals
- A static list in HTML, Print and RSS and the original place data in Markdown and LLMS, with zero configuration.
- An opt-in interactive map: numbered markers, popups with name, note, thumbnail, and link, an optional route line, and dark tiles when provided.
- No page scroll hijacking, keyboard operation, and localized controls.
- Vendored engine, loaded only on pages that need it.
Non-goals
- Google Maps, Mapbox SDKs, or any API-keyed engine bundled by the theme.
- A theme-chosen default tile service.
- A single-point
mapshortcode, named tile styles, custom marker icons or tones, or a static fallback image parameter in the first stage. - GPX or GeoJSON tracks, clustering, search, routing, or geocoding.
- Coordinate transforms for GCJ-02 or BD-09 tiles (see limitations).
- Map tiles or images generated at build time.
Proposed behavior
Places
The fence body is a YAML or JSON list. Each item:
| Field | Rule | Invalid input |
|---|---|---|
name |
Required, plain text | Item skipped with a warning |
lat |
Required number, −90 to 90 | Item skipped with a warning |
lng |
Required number, −180 to 180 | Item skipped with a warning |
text |
Optional plain text | — |
image |
Optional image through the shared image resolver; a local raster is resized for the list and popup | Unresolvable: warns, no thumbnail |
link |
Optional URL through the shared URL policy; a same-page #anchor is the common case |
Invalid: warns and is dropped |
Unknown fields warn. A fence with no valid place warns and renders nothing.
Explicit lat/lng keys avoid the latitude/longitude order confusion of
GeoJSON’s [lng, lat] arrays.
Fence attributes
| Attribute | Rule |
|---|---|
caption |
Plain text figure caption |
route |
true connects places in list order with a line |
zoom |
Integer 1–22 (implemented range; drafted as 1–19). Default: 15 for one place; fit all places otherwise |
height |
A positive px, rem, em, vh or vw length; a percentage or zero warns and keeps the default, a responsive frame capped below the viewport height |
id |
Validated element ID |
tab, group, value |
The shared adjacent-tab behavior; the map resizes when its panel is shown |
num is not supported, as for other diagram fences; wrap the fence in fig
when a Book number is needed.
Static form
HTML, Print and RSS use this static list.
Coordinates are shown as authored. The OpenStreetMap link is an ordinary outbound link, not a request.
Configuration
enable: true with a missing or invalid tiles or attribution warns and
leaves maps off. The guide shows configuration examples — OpenStreetMap’s
standard tiles (light use under the OpenStreetMap Foundation tile usage policy,
attribution required), a commercial service with a domain-restricted key, and a
self-hosted server — without making any of them a default. A key in a tile URL
is public; the guide says so.
Interactive map
When params.map is complete and the output is HTML:
- The figure gains a canvas and a JSON copy of the validated places;
hasMapselects thecontent-components.jsadapter and registers theleafletengine indata-td-component-engines. Leaflet’s stylesheet is linked only on those pages, as the Asciinema player’s is. - The adapter mounts each map within 320px of the viewport, like the other engines.
- Markers are numbered HTML markers matching the list numbers, styled with preset tokens; no marker images.
- Popups are built with DOM APIs (
textContent, element creation) from the JSON: name, note, thumbnail, link. NoinnerHTML. - Scroll-wheel zoom is off, so reading never zooms the map. Zoom buttons, keyboard control, and pinch remain. On narrow screens the frame stays shorter than the viewport so the page can always be scrolled past.
- With
dark_tiles, tiles follow the color scheme; without it, light tiles stay (no color inversion of map imagery). - Size is recomputed on resize, when a tab panel is shown, and when a disclosure opens.
- Attribution uses Leaflet’s attribution control with the configured text.
- If the engine or tiles fail, the canvas hides and the list remains.
The list stays visible under the map as its legend and as the accessible alternative.
Outputs
| Output | Result |
|---|---|
| HTML, maps off | Static form only; no canvas, script, or tile URL |
| HTML, maps on | Map above the static form |
| Browser print | Print rules hide the canvas; the list prints |
| Dedicated Print | Static form |
| Markdown / LLMS | The authored fence |
| RSS | Static form with absolute thumbnail URLs |
Engine
Leaflet (BSD-2-Clause) is small, needs no WebGL, and supports HTML markers and
keyboard control. On 2026-11-27 npm lists 1.9.4 as latest and 2.0 in beta
(2.0.0-beta.5, 2026-11-19). Vendor the current stable release at
implementation time, with license, version, source, and checksums in
VENDOR.json. If 2.0 is stable by then and is distributed only as an ES
module, the engine loader (a classic script with a readiness check) needs a
matching change first.
MapLibre GL with vector tiles or a single PMTiles file on object storage is the stronger long-term route to self-hosted maps, at a larger size and with WebGL. The fence format is engine-neutral, so a later proposal can switch or add an engine without changing content.
Photo pins from GPS metadata
A place with a local photo and no coordinates could take its position from the photo. Verified on Hugo 0.170.1:
Image.Exifwas deprecated in Hugo 0.155 and is now removed.Image.MetareturnsLat/Longonly when the site’simaging.meta.fieldsincludes the GPS fields. Hugo’s default field filter excludes GPS, and a theme cannot change a site’simagingconfiguration.- Published original photos keep their GPS data unless stripped, which can reveal private locations.
This is therefore a later stage: explicit coordinates first, then GPS-derived pins as a documented site opt-in with a privacy note.
Accessibility and privacy
The numbered list conveys everything the map does. Map controls get localized names. Tile requests send the reader’s IP address and the viewed area to the tile service, only after the site enables maps and only when a map comes into view.
Limitations
Coordinates are WGS 84. Map services in mainland China commonly use GCJ-02 (or
BD-09), so WGS 84 markers on those tiles appear offset by hundreds of meters.
The first stage documents this and supports only WGS 84 tiles. A later
params.map option could convert markers for GCJ-02 tiles if a site needs it.
Trade-offs and alternatives
| Option | Decision | Reason |
|---|---|---|
| Google Maps | Rejected | Keys and billing, terms that restrict caching, regional blocking, third-party scripts |
First-draft single-point {{</* map */>}} shortcode |
Removed | A second form for what a three-line fence expresses |
| CARTO light/dark tiles as the default | Removed | A commercial service with its own usage terms; the theme should not choose it for every site |
styles, center, marker icon and tone, fallback image, full |
Removed for now | Numbered markers tie the map to the list; a fallback image duplicates the list |
| Hiding the list when the map mounts | Rejected | The list is the legend, the accessible alternative, and the print form |
| Static map images rendered at build | Rejected | Needs tiles at build time, contradicting offline builds |
| Click-to-load maps | Shipped as loading: click |
Lazy loading on approach is the engine norm and stays the default; params.map.loading: click waits for an explicit button where privacy review or touch scrolling demands it |
Costs: a vendored engine to maintain, a configuration step before any map appears, and no default look out of the box. These follow directly from the network policy.
Compatibility
Additive. map is a new fence language and params.map a new key. With maps
off, a page with a map fence is fully readable.
Implementation plan
- Vendor Leaflet under
assets/third_party/leaflet/withVENDOR.jsonentries. render-codeblock-map.htmlwith a parse partial (validation, thumbnails via the image resolver and processing), static form, and enabled form.params.mapinhugo.yaml, the resolver with Draw.io-style completeness warnings,bin/check-params.py, and the generated configuration schema.- A
leafletadapter incontent-components.js;scripts.htmlengine and stylesheet registration; unit tests with a stubbed engine. - Locale keys in all 32 files:
ui_map_labelandui_map_open_osm; the zoom controls reuseui_diagram_zoom_inandui_diagram_zoom_out. - Fixtures: maps off and on, one and many places, invalid places, route,
thumbnails from each source kind, tabs, and each output. Owning checks:
check-components.py(data fences),check-runtime-isolation.py,check-vendor.py,check-output.py,check-output-security.py,check-goldens.py,check-stylesheets.py,check-params.py,check-i18n.py,node --test. - Browser review on this site with a configured tile service: keyboard, touch scrolling, dark tiles, tabs, presets, print.
Acceptance criteria
- With maps off, no output contains a tile URL, the Leaflet script, or its stylesheet.
- With incomplete configuration, the build warns and behaves as maps off.
- The list is identical with maps on and off.
- Scroll-wheel input over a map scrolls the page.
- Popups contain no author HTML.
Open decisions
- List presentation under the map. Recommended: always visible, compact. Alternative: collapsible for long lists.
- Marker style. Recommended: numbers only in S5; icons later on request.
- Engine version. Recommended: decide between 1.9.4 and 2.x when S5 starts.
- GCJ-02 support. Recommended: out of scope until a site asks.
Decision log
- 2026-11-27 (first draft).
mapfence plus single-point shortcode, CARTO default tiles, named styles, marker icons and tones, fallback images, and EXIF pins in C3. - 2026-11-27 (review). One fence; no default tile service; the list is
always rendered; EXIF pins moved to a later stage after verifying Hugo’s
Image.Metadefaults. - 2026-11-27 (implementation). Implemented with vendored Leaflet 1.9.4 (
VENDOR.json),render-codeblock-map.html,content/map-config.html, aleafletadapter incontent-components.jsandassets/css/td/map.css. Differences from this draft: the fence is parsed as YAML by resource name, because Hugo’s content sniffing reads a YAML list written as- {name: …}as JSON; the zoom controls reuseui_diagram_zoom_inandui_diagram_zoom_out, so onlyui_map_labelandui_map_open_osmare new;params.mapis validated on every page. Invalid input is covered inbin/check-content-primitives.pyandbin/check-params.py;tests/js/content-components-map.test.jscovers the adapter. - 2026-11-27 (review hardening). Fixed
{s}subdomain tile validation and YAML.nancoordinate build crash; raised selector specificity inmap.cssto outrank body-endleaflet.css, aligned popups/controls/focus rings across all four presets and dark mode, fixed popup close-button overlap, dark-mode print ink,slatedark--td-on-link, RTL popup/coordinate direction, forced-colors popup border, and print pagination; added touch single-finger scroll pass-through,keyboard-nav.jsmap-focus yield, complete tile-failure canvas hiding,prefers-reduced-motionsupport, markeraria-label,Escapepopup dismissal, localized close label,tabs.js-first ordering for hidden tabs, list-click panning, andrich-copy.jscanvas exclusion; added optionalattribution_url(OSM copyright link compliance),subdomains, andloading: click(32-localeui_map_load), plus Playwright regression coverage intests/browser/map.spec.mjs. - 2026-11-27 (adversarial review). A non-string
params.map.loading(a list or map) stopped the build, becausecondevaluatedstrings.TrimSpaceon it; it now warns and keepslazy. Tile templates may use only{s},{z},{x},{y},{-y}and{r}: any other placeholder, in the host, path or query, warns at build time, since Leaflet throws on one it cannot fill and left an empty map. When every first tile fails, the map is removed only after Leaflet finishes dispatching the layer’sload, which otherwise threw aTypeError; failingdark_tilesfall back to the dimmed light tiles instead of removing the map for good. Theloading: clickbutton names every host the map may contact,{s}as*and thedark_tileshost included.tests/browser/map.spec.mjsruns intest:content-components. Minor follow-ups: a pen drags the map like a mouse; a popup opened with Enter takes focus and returns it to its marker when closed from inside; a load button activated from the keyboard hands focus to the map;params.map.subdomainsis documented as empty by default (Leaflet’sabc);ui_map_loadreads “Завантажити мапу” in Ukrainian and “טעינת המפה” in Hebrew.
11 - Social post component
> [!SOCIAL] callout — author, handle, avatar, date, link, and a Markdown body — with no build-time fetch and no runtime.> [!SOCIAL]The > [!SOCIAL] callout form ships in OINK v1.8.0. The
Social posts guide documents it, the
Components contract
governs it, and shared decisions are in the
overview.
| Record | Value |
|---|---|
| Status | Accepted and shipped in OINK v1.8.0 (> [!SOCIAL] callout form, 2026-11-28) |
| Owner | OINK maintainers |
| Delivery stage | S3 |
| Form | Callout with a Markdown body: > [!SOCIAL] Name `@handle` plus a block attribute line |
| Public API | Callout type social; title as the identity line; attributes avatar, date, url, platform; locale key ui_social_view_original |
| Runtime | None |
| Implementation | layouts/_markup/render-blockquote-alert.html, layouts/_partials/content/social.html, assets/css/td/social.css, fixture tests/site/content/fixtures/social.md, migration bin/migrations/oink06/transforms/social.py |
Summary
The card shows the avatar, name, handle, platform icon, body, attached images,
date, and a link to the original. Everything comes from the page; nothing is
fetched at build or view time. platform (default none) selects the icon
for X, Bluesky, Mastodon, Threads, Weibo, Zhihu, Telegram, or LinkedIn posts
with the same layout. Outside Hugo the source is an ordinary blockquote, so
GitHub, an editor preview, or Obsidian shows the name, text, images, and any
quoted post.
Problem
Hugo’s built-in x shortcode requests oEmbed data from X at build time (Hugo
caches the response locally, so a clean build such as CI fetches it again),
and the resulting embed loads widgets.js in the reader’s browser. For OINK
that means:
- the build needs the network, contradicting the rule that a normal build downloads nothing, and fails where X is unreachable;
- readers load a third-party script with tracking and layout shift;
- the quote disappears when the post is deleted, made private, or the account is renamed;
- the card ignores OINK’s presets, color schemes, Print, Markdown, and RSS.
The v1.7.0 social shortcode solved those, but its source read poorly outside
Hugo: in plain Markdown the opening tag and the first line of the post merge
into one paragraph, the closing tag hangs off the last one, and a parameter
avatar never shows. Its Markdown output also needed a second, hand-built
attribution renderer.
The common workaround, a screenshot, is inaccessible (text in pixels), not searchable, and absent from LLMS output.
Design principles
- A quoted post is a quotation. It renders as
<figure>+<blockquote cite>+ attribution — an editorial card that reads as a citation, not a pixel copy of the platform. - The page holds the content. The author saves the text and media once; the theme renders what is there and never fetches.
- Compose the body. Images, galleries, and quoted posts are written with syntax OINK already has, so the card needs no parameters for them.
- The platform identifies, it does not restyle. One layout for all
platforms;
platformchanges only the icon. - Leave Hugo’s names alone. The component has its own name, so Hugo’s
embedded
xkeeps working exactly as Hugo documents it. - Markdown first. A quoted post is a blockquote with attribution, which Markdown already writes. The callout title is the one slot Goldmark hands over separately, so it carries the identity line, and block attributes carry the facts Markdown has no syntax for.
Goals and non-goals
Goals
- A recognizable, accessible post card with zero network use and zero JavaScript.
- Text, links, images (with Image Zoom), multi-image grids, and one level of quoted post.
- The same static card in Print, the author’s own blockquote in Markdown and LLMS, and a blockquote with attribution in RSS.
- A source that reads as a quotation in any Markdown viewer.
Non-goals
- Fetching anything, at build time or in the browser; the theme never calls a platform API.
- Overriding or changing Hugo’s built-in
xshortcode. - Engagement counts (likes, reposts, replies, views) and verification badges.
- Per-platform skins, brand colors, or imitation of a platform’s interface.
- Threads, replies, polls, or video playback inside the card. A post’s video is written as a Video in the body.
- GitHub issues, Hacker News, Reddit, or link-preview “bookmark” cards; their data shapes differ.
- A data-file form or an author registry in the first stage.
Behavior
Title and attributes
| Part | Rule | Invalid input |
|---|---|---|
| Title | The identity line, rendered as written with inline Markdown. Each code span becomes the handle (<span class="td-social__handle" dir="ltr">); the rest is the name |
Missing: see below |
avatar |
Image path through content/image-resolve.html (parameter="avatar"); decorative (alt="") because the name is adjacent |
Unsafe scheme or non-image resource: warns naming avatar and drops; a static path missing from the project’s own static/ (checked only when that directory exists, after decoding and cleaning the path): warns with the ID social:avatar-static, which a site using module mounts or a custom staticDir can list in ignoreLogs, and keeps the path; a static path that climbs above the site root with ..: warns (social:avatar-static), is dropped, and the card draws the initial; remote HTTPS URLs are never fetched |
date |
Plain text. YYYY-MM, or YYYY-MM-DD optionally followed by T or a space, HH:MM, optional :SS, and an optional Z or ±HH:MM, on a real calendar day, becomes <time datetime> (the space written as T); anything else renders as <span class="td-social__date"> |
— |
url |
Original post, through the shared URL policy (HTTP/HTTPS with rel="external", or site-internal path without rel="external"). Optional, so a deleted post can still be quoted |
Invalid: warns and is dropped |
platform |
x, bluesky, mastodon, threads, weibo, zhihu, telegram, linkedin, none (default at every depth) |
Unknown or empty: warns, uses none |
content/attributes.html validates the attribute line: class, data-* and
aria-* pass to the figure, and any other name warns. Attribute values are
strings, so the shortcode’s type warnings have no counterpart. A + or -
fold marker warns and is ignored.
A title is required. Without one, the callout warns and renders the body as a
plain blockquote (or a blockquote link when the body is empty and url is
valid), so the quoted words are not lost. With a body, url survives only as
the quote’s cite attribute; date, platform and avatar are ignored.
Without an avatar, a circle shows the first grapheme cluster of the title’s
plain text after leading @, spaces, and invisible format characters are
removed, falling back to a person icon if nothing visible remains; no default
avatar or Gravatar is requested.
The render hook cannot see an enclosing callout, which is why the default
platform is the same at every depth instead of x on top-level cards.
Body
The body is the callout’s own Markdown, rendered with the page:
| Content | Written as |
|---|---|
| Text, line breaks, links, code | Ordinary Markdown |
| One attached image | A Markdown image; it gets Image Zoom when eligible |
| Several images | A gallery fence inside the body (compact grid matching the card radius) |
| A quoted post | A nested > [!SOCIAL], whose attribute line carries one >; it is styled by the .td-social .td-social descendant selector |
| A video | A Video image line |
Footnotes in the body resolve like any page footnote. An empty body warns;
with a valid url the card renders as a link-only card (or a blockquote link
without a title), otherwise it renders nothing.
Rendering
| Platform | Icon (vendored Font Awesome 7.3.1) |
|---|---|
x |
fa-brands fa-x-twitter |
bluesky |
fa-brands fa-bluesky |
mastodon |
fa-brands fa-mastodon |
threads |
fa-brands fa-threads |
weibo |
fa-brands fa-weibo |
zhihu |
fa-brands fa-zhihu |
telegram |
fa-brands fa-telegram |
linkedin |
fa-brands fa-linkedin |
none |
None |
The icon is decorative and monochrome; the platform name is available to
assistive technology as visually hidden text when present. The card uses
elevated surface tokens (--td-brand-elev) with --bs-body-bg for nested
quotes, keeps body typography independent of blockquote’s Kai rule, and
follows each preset’s geometry (0px in Ink, 2px and square avatar in
Terminal). Print maps the card to --td-print-* tokens regardless of screen
color mode and prints the original URL after the link. RTL mirrors through
logical properties while isolating LTR handles and ISO timestamps; long
handles and URLs wrap.
Outputs
| Output | Result |
|---|---|
| HTML | The card; no runtime. Body images opt into the shared Image Zoom as usual |
| The static card on the paper palette with the URL visible | |
| Markdown / LLMS | The callout exactly as written, with its attribute line; a nested post stays a nested blockquote |
| RSS | A <figure> with <blockquote cite> (omitted on link-only cards) and an attribution line using absolute URLs, the handle as plain text; no avatar |
Hugo’s own x
Hugo’s embedded x shortcode remains available and unchanged: it fetches
oEmbed data at build time and loads X’s script in the browser. OINK does not
intercept it. The guide recommends the [!SOCIAL] callout for offline,
permanent quotes.
Overriding x was the first plan and was rejected after a probe on Hugo
0.170.1: a shortcode template that reads .Inner makes Hugo’s parser require
every call to be closed or self-closed, so Hugo’s documented unclosed form
{{</* x user="…" id="…" */>}} would fail to build
(shortcode "x" must be closed or self-closed) before any template could warn.
Rights and archiving
The theme stores nothing by itself. Authors decide what they may quote and
which avatars and media they may keep; the guide says so. A card persists after
the original is deleted, which is the point of offline quoting; url is
optional so the author can drop a link that no longer resolves.
Trade-offs and alternatives
| First-draft element | Decision | Reason |
|---|---|---|
The name x, replacing Hugo’s built-in |
Renamed social (owner, 2026-11-27) |
No conflict with Hugo, no parse failure for existing x calls, and the name reads naturally for every platform |
likes, reposts, replies, views |
Removed | Snapshots that go stale and mislead; four locale keys |
verified (blue, gold, gray) |
Removed | Platform-specific, changes over time, and implies verification the theme cannot perform |
images and image_alts lists |
Replaced by body images and gallery |
Alt text stays next to each image; Zoom, processing, and resolution come for free |
quote_author, quote_handle, quote_date, quote_url, quote_text |
Replaced by a nested social |
Same parameters, same rules, no parallel set |
data= file form |
Removed | A data file per post is a second authority; a helper can write shortcode text |
data/x_authors.yaml registry and automatic assets/avatars/<handle>.* lookup |
Removed for now | avatar="avatars/name.jpg" already shares one global file; implicit file lookups are hard to discover |
github, hackernews, reddit platforms |
Removed | Titles, threads, and missing avatars are a different component |
| Automatic handle prefixes per platform | Removed | Handles are shown as written |
| Per-platform styles | One layout | Presets own color; platform redesigns would otherwise date the theme |
The social shortcode with six parameters (shipped in v1.7.0) |
Replaced by the [!SOCIAL] callout (owner, 2026-11-28) |
The source reads as a quotation in any Markdown viewer, Markdown and LLMS output is the source itself, and footnotes, Image Zoom and other hooks apply to the body without a block renderer |
A plain blockquote with a closing — Author line and {.social} |
Rejected | The hook would have to parse the attribution out of rendered HTML to lay out the header and the date line |
| An avatar written as a Markdown image in the title | Rejected | A probe on Hugo 0.170.1 shows that an image ends the alert title: text after it moves into the body, and a trailing image leaves an empty paragraph |
| The date link written in the title | Rejected | It would hide the date and URL in a presentation string and lose <time>, cite, and the RSS absolute URL |
Reusing [!QUOTE] with social attributes |
Rejected | Attributes would decide whether one type renders as a callout box or a card |
Companion helper
Writing the parameters by hand is the main friction. A future
oink fetch social <url> in ../oink-cli could, once at writing time,
download the avatar and media into the page bundle and print a ready
[!SOCIAL] callout. It is outside this proposal and needs its own oink-cli
proposal, because the endpoints it would use are unofficial, may change or be
restricted, and raise terms-of-use questions. The theme never depends on it.
Compatibility
- v1.7.0 added the
socialshortcode, taking the count from 29 to 30. - The callout form removes it again (30 back to 29) and adds the
socialcallout type. A page that still calls the shortcode fails to build withtemplate for shortcode "social" not found. bin/migrations/oink06.py migrate --only socialrewrites every call:authorbecomes the title text,handlea code span, the other parameters the attribute line, and a nested call a nested callout. It writesplatform="x"on top-level cards that relied on the shortcode’s default and reports calls it cannot express. On vonng.com it converted 492 calls (89 nested) in 149 files with no findings, and 88 cards rendered from four converted bundles matched the v1.7.0 cards in platform, nesting, images, links, dates and visible text.- Block attributes need
markup.goldmark.parser.attribute.block: true, which OINK already requires.
Implementation and checks
| Part | Where |
|---|---|
| Template | layouts/_partials/content/social.html, reached from the social branch of layouts/_markup/render-blockquote-alert.html (shared attribute, URL and image partials; static Print and RSS branches) |
| Styles | assets/css/td/social.css |
| Locale | ui_social_view_original in all 32 catalogs |
| Fixture | tests/site/content/fixtures/social.md and its Chinese peer, pinned by HTML, Markdown, Print and RSS goldens |
| Invalid input | Thirteen social-* cases plus check_social_posts() and template/CSS contract checks in bin/check-content-primitives.py; bin/check-components.py keeps the shortcode deleted and failing as missing; Playwright coverage in tests/browser/social.spec.mjs |
| Migration | bin/migrations/oink06/transforms/social.py, frozen by tests/migrations/test_oink06.py |
| Guide | Social posts |
Acceptance criteria
- A build with network access disabled renders every fixture.
- No
socialpage requests anything from a platform host, at build or view time. - Markdown and LLMS contain the source callout and no component HTML.
- A plain Markdown viewer shows the name, handle, body, images and quoted post as a blockquote.
- Invalid input warns and keeps the quoted words whenever a body exists.
- Preset, color-scheme, narrow-screen, RTL, forced-colors, and print reviews pass.
Open decisions
- Platform list. Expanded to
x,bluesky,mastodon,threads,weibo,zhihu,telegram,linkedin, andnone. Add another platform only with a vendored icon and an author request. - Author registry. Recommended: not yet; reconsider after real pages show repeated metadata.
Decision log
- 2026-11-27 (first draft). Offline
xwith a platform enum of eight, metrics, verification badges, image and quote parameter sets, a data-file form, and an author registry. - 2026-11-27 (review). Reduced to six parameters and a composed Markdown
body; recorded the verified parse failure for legacy
xcalls. - 2026-11-27 (owner). Renamed to
socialto avoid conflicting with Hugo’sx;platformkeeps the other platforms. - 2026-11-27 (implementation). Implemented as specified, with the platform name added as visually hidden text and the print rule showing the original URL after the link.
- 2026-11-27 (deep review & hardening). Fixed dark-mode print cutout,
nested CSS specificity, RTL BiDi isolation, nested platform SR symmetry,
anonymous empty+url output, HTML5
<time>validation, grapheme initial slicing, compact card gallery layout, CJK body font isolation, forced-colors avatar border, offlinestatic/avatar warning, and context-aware Markdown inline escaping; addedzhihu,telegram, andnoneplatforms and Playwright regression coverage. - 2026-11-27 (adversarial review). Initials skip invisible leading
characters (zero-width space, BOM, bidi marks, any Unicode space); the static
avatar check decodes and cleans the path, warns on
..above the site root, and makes its missing-file warning suppressible associal:avatar-static; Markdown ends every card with a blank line so adjacent cards stay separate quotations; the guide’s date, avatar-resolution and anonymous-card wording now matches the implementation. - 2026-11-28 (owner). Markdown first: what Markdown can present is not
converted. The shortcode’s source read poorly in plain Markdown, so the card
becomes the
> [!SOCIAL]callout; the title is the identity line with the handle as a code span, andavatar,date,urlandplatformbecome block attributes. Probes on Hugo 0.170.1 confirmed that the title keeps inline Markdown, that attributes attach directly under a callout and under a nested one with a single>, and that an image cannot sit in the title. - 2026-11-28 (implementation). The shortcode and
content/markdown-escape-inline.htmlare deleted; the card renders fromcontent/social.html;platformdefaults tononeat every depth because the hook cannot see a parent; nested styling moves to a descendant selector and the deeper-nesting warning is dropped; Markdown and LLMS keep the source; the migration toolkit gains asocialtransformation.
12 - OINK CLI and the next product stage
The independent Go repository pgsty/oink-cli and first-stage development were authorized on 2026-09-29. Its six commands now have a local 0.1.0-dev implementation, with final local acceptance recorded separately. Current behavior belongs to the CLI decision and result contract and CLI introduction. Theme 1.2, its tooling descriptor, Docsy migration, version lifecycle, OpenAPI, MCP, and Studio remain proposals.
| Record | Value |
|---|---|
| Status | Repository choice and first-stage scope accepted. Local candidate implemented and validated. Later roadmap remains draft |
| Owner | OINK maintainers |
| Date | 2026-09-29 |
| Scope | OINK theme, independent CLI, existing Starter, and documentation site |
| Affected contracts | Architecture, configuration/diagnostics, outputs, migration, and later version navigation/API content |
| Source snapshot | Theme HEAD 3a18234, documentation HEAD 85f16bf, Starter HEAD 137843b, plus the explicitly identified local work below |
Recommendation
Create a separate oink-cli repository, publish one executable named oink, and keep OINK as the single product identity. The theme renders content. The CLI helps users initialize, inspect, validate, upgrade, and eventually migrate their sites. The documentation site continues to own public guides, bilingual design records, and integration acceptance.
The CLI contract owns first-stage behavior, while the dated acceptance record lists executed checks and remaining limits. This roadmap stays active for its later stages and adoption targets.
The first release should improve the path from an existing repository to a reliable publication. Its four main workflows are doctor, check, init, and upgrade. dev and build may provide small, transparent Hugo shortcuts. A supported Docsy migration path follows evidence from actual input repositories. Version lifecycle and OpenAPI generation come after that first usable release, with one major content-model project active at a time.
Keep the theme usable without the CLI. Commit or otherwise deliver generated Hugo inputs. After you remove the CLI, ordinary Hugo must still be able to build the site. Regenerating those inputs remains a separate operation.
Product position and target user
Recommended public description:
OINK is a local-first documentation toolkit built on Hugo, publishing engineering knowledge for readers and agents.
Retain “Hugo theme” in installation and discovery pages because it describes what users install, while “knowledge compiler” describes the internal architecture. A new name should keep the current Markdown/Hugo workflow clear.
Prioritize Git-oriented maintainers of open-source infrastructure, developer tools, and multilingual technical documentation. They need to get a site working, diagnose failures, upgrade safely, and move content without losing URLs or meaning.
For the first stage, non-goals include a visual CMS, hosted accounts, a deployment control plane, a package marketplace, an LLM runtime, a semantic-search service, and a new rendering engine. Books, blogs, and landing pages remain supported, but their feature catalogs do not drive this roadmap.
Evidence and changes to the research recommendation
This proposal considers the supplied strategy report and checks it against the local implementation, bilingual Design section, Starter, and current primary documentation.
| Observation | Product consequence |
|---|---|
| OINK already has a public Starter, generated configuration schemas, migration scripts, publication tools, and focused theme checkers | Provide selected workflows as product features. Do not create a second implementation of every tool |
| The front-matter schema deliberately omits type constraints | Strict checks must follow the owning resolvers and actual Hugo output |
| Existing version support includes a cross-site menu, archive banners, and optional path concatenation | Focus on lifecycle and reliable page correspondence |
| Current version documentation explicitly uses independent Hugo builds | Preserve that model initially. Do not silently add a multi-version renderer to one build |
| OpenAPI widgets become specification links outside HTML and have documented accessibility exclusions | Static, accessible endpoint content is a concrete future improvement |
| Backlinks are implemented. G2/G3 remain draft | Graph visualization remains a draft proposal |
bin/update-consumers.py exists in this working tree as local maintenance tooling |
Its release-resolution and preservation rules serve as design input for oink upgrade |
The supplied report emphasizes adoption and an optional tools layer. Four changes make its recommendations implementable:
- Put safe upgrades alongside initialization and diagnosis. Existing users have an immediate, testable maintenance need.
- Separate maintainer regression checkers from consumer checks. A synthetic-fixture checker is not automatically a general-purpose site validator.
- Treat migrations as supported input profiles with explicit boundaries rather than complete Docsy or arbitrary MDX conversion.
- Replace the simultaneous versioning/OpenAPI/graph/platform program with sequential decisions.
Existing tools illustrate the workflow tradeoffs. Mintlify’s CLI exposes preview, validation, and link checking. Nimbus combines scaffolding and agent-readable output while remaining pre-1.0. Docusaurus makes version snapshots explicit and warns about their maintenance/build cost. Copying Nimbus’s full source-owned UI model would move upgrade work to OINK consumers. Use that pattern for small generated recipes. Keep the upgradable theme module.
Why a separate repository
| Option | Benefit | Cost | Decision |
|---|---|---|---|
Extend Python scripts under theme bin/ |
Fastest small maintenance improvements. Tests accompany the change | Difficult installation and distribution. No unified public command contract | Retain for internal and historical tooling |
Put cmd/oink in the theme’s root Go module |
One checkout and atomic source edits | Mixes a Hugo asset module with application dependencies, binary releases, and consumer support | Do not choose for the public CLI |
| Use an isolated Go submodule in the theme repository | Atomic repository changes without sharing Go dependencies | Separate module tags and releases still need management. Code can more easily depend on unpublished theme internals | Viable fallback for a prototype with a fixed time limit. Not the preferred product repository |
Create pgsty/oink-cli |
Clear executable boundary, independent releases, no need for users to clone theme internals | Requires explicit compatibility and cross-repository acceptance | Accepted. Local Go repository created |
This decision assigns release and maintenance responsibilities rather than claiming that a monorepo is technically impossible. A nested module can isolate dependencies, and separate repositories still require coordination: a renderer change may need two pull requests, paired contracts, and a compatibility test. OINK already operates a theme/site/Starter split, so that cost is acceptable if the public boundary stays small.
Theme and CLI releases must not share a forced version number. A proposed oink CLI 0.1.x should work with a tested OINK 1.1.0 baseline and the next supported theme release. Declare compatibility per capability. Report unsupported functionality. Do not assume that every schema from the newest theme is valid for every older site.
Do not create separate repositories for the linter, migration engine, OpenAPI generator, or a shared SDK now. They can begin as internal CLI packages. The binary can be built in Go without importing Hugo’s internal Go packages or making the theme module depend on the CLI.
Responsibility map
| Surface | Owner | Boundary |
|---|---|---|
| Layouts, components, style, navigation, search, accessibility, output semantics | pgsty/oink |
Executes inside Hugo and the static site |
| Theme defaults, owning resolvers, generated schemas, output schemas | pgsty/oink |
Authoritative theme behavior and its projections |
| Theme implementation checks and narrow invalid-input fixtures | pgsty/oink |
Remain maintainer tools, even if implemented in Python or JavaScript |
| Environment diagnosis, consumer checks, initialization, upgrade; later migration transformations | pgsty/oink-cli |
Initial commands implemented locally; migration remains proposed |
| OpenAPI parsing and generated source, later version snapshot orchestration | Proposed later pgsty/oink-cli capabilities |
Produces ordinary Hugo inputs; does not own final rendering |
| Small official site skeleton and language profiles | pgsty/oink-starter |
Single source for CLI initialization. Pinned snapshots can be embedded in CLI releases |
| Guides, examples, PRDs, accepted rationale, EN/ZH integration/browser review | pgsty/oink.pgsty.com |
Continues as the canonical public documentation and regression site |
| Hosting credentials, account setup, deployment authorization | Consumer workflow | Existing CI/provider tools. The first CLI release does not deploy |
The CLI reads Hugo’s effective configuration, the resolved theme’s published contract artifacts, and rendered outputs. It must not guess the final page tree from filenames or maintain a second navigation resolver. Hugo config exposes effective configuration. Module inspection must also account for replacements, workspaces, and vendoring.
Next theme release: proposed OINK 1.2
This section remains draft. The local CLI candidate works against published OINK v1.1.0. The first-stage CLI decision neither accepts nor requires a 1.2 release or a new tooling descriptor.
Set an adoption objective for this release: a site can explain its configuration and output capabilities to tools, and upgrade without adopting a new authoring model. The release should be small enough to ship independently of the broader roadmap.
| Priority | Requirement | Acceptance |
|---|---|---|
| P0 | Package a small, versioned tooling descriptor beside existing schemas, describing available schema/output contracts and supported toolchain boundaries | Check the descriptor against its owning implementation. The CLI can inspect it from the resolved module. No extra per-page output or runtime request |
| P0 | Make selected high-value configuration diagnostics actionable: parameter, invalid value, expected form, fallback, and owning guide | Cover actual onboarding failures such as Goldmark/output/language configuration. Retain ordinary preview warnings and strict publication failure |
| P0 | Preserve one navigation and Markdown authority across reader and machine outputs | Existing output and navigation checks continue to cover language, ordering, subpath, and opt-in behavior. No duplicate CLI renderer |
| P0 | Release with a tested Starter snapshot and a reviewed downstream adoption record | Validate published module resolution separately from sibling replacement builds. Record consumer pins and deployments independently |
| P1 | Add stable identifiers to the small set of diagnostics consumed by tooling, if the prototype shows they are necessary | A focused owning checker verifies each identifier. The CLI never depends on parsing all human warning prose |
The descriptor contains release metadata without becoming a configuration authority. Configuration schemas remain generated from current authorities, whose resolver/checker continues to own optional shape validation. A generic renamed-key registry would conflict with the current diagnostic decision. Migration transformations therefore belong to explicit CLI profiles rather than a permanent compatibility path in templates.
No new visual component family is required for 1.2. Correctness, accessibility, and already-demonstrated regressions can still justify changes. Existing media work keeps its own acceptance scope. This roadmap does not require every draft to be complete before release.
First CLI release: proposed 0.1
The commands below are implemented in the local 0.1.0-dev candidate. Their current flags, result semantics, and limits are defined by the CLI contract and CLI introduction.
| Command | User outcome | First-release boundary |
|---|---|---|
oink doctor |
Understand why the site cannot run or why its environment differs from CI | Inspect Hugo Extended/version, module pin and effective source, Starter/toolchain requirements, essential configuration, and enabled outputs. No repair by default |
oink check |
Know whether a publication build and its local references are valid | One strict build into isolated output, then check local links/anchors/assets and enabled machine outputs. Report coverage and unsupported checks |
oink init my-docs |
Start a small, neutral site that can be maintained without the CLI | Generate from a pinned Starter snapshot into a new/empty target. Select the supported language profile and explicit theme pin |
oink upgrade --to <tag> |
See the exact changes needed for a theme upgrade | Preview first. --write applies a reviewed scope after validation. Protect unrelated module dependencies, user changes, and vendored output |
oink dev / oink build |
Use a memorable entry point without learning a second build system | Thin Hugo invocations with visible effective arguments. build uses publication strictness. Direct Hugo remains fully supported |
check is the single quality entry point. Avoid separate overlapping lint, validate, audit, and check products in 0.1. Later --scope options can separate source hints from rendered-output validation when users need the distinction.
Diagnosis and quality scope
Start with failures that users can act on and that checks can identify reliably: wrong toolchain, unresolved theme, malformed required configuration, missing local link targets/anchors/assets, and inconsistent enabled output references. Resolve routing and anchor truth from Hugo’s output, including language and base-path handling. Do not label a valid custom front-matter key as invalid merely because an editor schema does not list it.
Disabled optional outputs are not missing-output errors. The local candidate does not check translation completeness. Any future completeness rule must use the site’s declared languages and coverage policies. Duplicate titles, orphan pages, missing descriptions, prose style, and freshness remain later optional observations after real false-positive review. Browser accessibility and interaction checks remain in the site Playwright/axe suite.
The local candidate freezes oink.result/v1. Structured diagnostics have stable rule IDs, severity, known locations, explanations, actions, and explicit coverage. JSON stdout contains only the result. Logs go to stderr. No command waits for input. Exit meanings are 0 for completed work with no blocking findings, 1 for policy findings, and 2 for required incomplete work. Required unsupported checks cannot succeed. The result contract owns the detailed fields. Build-derived findings never receive invented line numbers.
Keep raw Hugo errors available as subprocess evidence. A future SARIF export can project from the same result without changing rule semantics.
Upgrade and file preservation
The existing consumer-upgrade script provides local precedents: distinguish declared pin from resolved version, disable both workspace mechanisms for release verification, recognize module replacements, and inspect _vendor. Port those behaviors with focused tests inside the standalone Go binary.
For 0.1, upgrade one explicitly selected site. Multi-site fleet discovery stays with the maintainer script until a consumer need is demonstrated. A normal check may examine an intentional local theme replacement. check --release must verify the declared published release without those replacements. It should report a conflicting go.mod replacement rather than edit it away.
Preview the proposed touched files and verify the prospective upgrade before applying it. Back up only those files, refuse changes to files that changed since the preview, and preserve unrelated dirty work. A failed operation must describe what was and was not applied, with a recovery path that does not overwrite subsequent edits. A dirty repository is not a reason to block read-only diagnosis. Refreshing vendor content requires a separate explicit action.
Do not commit, push, deploy, alter global agent settings, or install system packages as side effects of initialization or repair. Initialization creates the requested named directory. Changes to existing files default to a preview.
Distribution and offline behavior
The local candidate currently provides a tested source/Make installation path and archive preparation on macOS arm64, with other archive targets cross-compiled. A published Homebrew formula and public download/tag installation remain future distribution work.
Use a Go executable with release archives/checksums and a Homebrew installation path. Initially qualify macOS and Linux on tested architectures. Mark other targets experimental until you validate their filesystem and process behavior. The installed CLI itself needs no installed Go toolchain, Python, Node, or account. Hugo remains an external renderer. Initial module resolution still needs the site’s documented Git/Go/Hugo toolchain.
Embed or ship an exact, licensed Starter snapshot for deterministic initialization. Do not fetch a moving main branch on every invocation, and do not maintain handwritten CLI copies of Starter configuration. Check embedded/template drift during CLI release.
Distinguish a cold installation from offline operation. Downloading Hugo, the theme, or an uncached template requires connectivity unless supplied locally. Once dependencies are present, local diagnosis/check/build paths must work without external services. On a cache miss, an offline request must fail clearly without fetching silently. External URL checking, remote specifications, and other network actions are separate opt-ins. No default telemetry or background update check is required.
Migration: the first expansion
Start with a documented Docsy input profile selected from actual candidate sites, reusing the current migration fixtures and report model as evidence. Validate configuration, navigation, assets, languages, and routes as well as Markdown syntax.
Proposed workflow: oink migrate --from docsy --source <site> --output <new-site>. Assess the migration before writing. Apply it only with an explicit flag and a separate destination. Every source item receives one primary status: unchanged-compatible, transformed, manual-review, or unsupported. Counts must reconcile, with reasons and source locations. Custom templates and dynamic behavior remain visible manual work.
Acceptance means source preservation, idempotent supported transforms, no edits inside literal code examples, valid local references, and an explicit old-to-new route report. Prefer unchanged URLs. URL changes require a redirect plan for the hosting target.
Arbitrary JSX, imports, and embedded React/Vue are programs. Do not execute untrusted source to infer their meaning or silently drop unsupported constructs. Start a second framework only after the first profile is reused successfully without maintainer rescue. Full MDX migration is a later product investment.
Next content capability: version lifecycle
After the first CLI is useful, version lifecycle is the default next candidate because it extends OINK’s existing independent-build model. Move OpenAPI ahead only if real API users provide the stronger repeated need. Do not implement both foundations simultaneously with one primary maintainer.
Theme responsibilities: consistent version identity in the reader surface, reliable page switching, archive status, and correctly scoped search/machine outputs. CLI responsibilities: inspect/list versions, prepare a snapshot, validate page correspondence, and change declared lifecycle state. Use oink --version for the executable. A future oink docs version ... namespace would distinguish documentation versions.
Prefer a small version manifest with version label, source reference, base URL, status, and default selection. Keep independent per-version builds and existing external archives. CLI-managed manifests may produce checked-in Hugo configuration; in that mode, authors edit the manifest and configuration becomes a checked projection. Existing manually managed params.versions remains supported. The initial prototype must settle this projection before freezing its format.
Page correspondence needs a logical page key scoped by documentation family, language, and version. Reuse a suitable existing translationKey or explicit stable key before inventing universal UUIDs. You should disclose missing peers and link them to a defined version/section landing page. You should not fabricate an equivalent page or concatenate an unchecked URL. Route aliases handle moves separately from page identity.
Distinct historical content should ordinarily keep its own canonical URL. Do not point every old page at the newest version. Language alternates must refer to genuine translated peers in the same version. Default search and agent bundles stay inside the selected language/version. A cross-version collection, if later needed, is explicit. Archiving preserves the source and records how the built artifact is retained. It does not delete the source or silently redeploy an immutable archive.
NAVJSON v1 currently has closed object schemas. Adding version or identity fields therefore requires an explicit new schema/output contract or a separate artifact, not a supposedly harmless addition to v1. No change to current page identity is justified merely to reserve space for a future graph.
Following capability: static OpenAPI reference
The first OpenAPI product should be a read-only static reference generator. The CLI parses a local specification and supported local references, emits ordinary Markdown/Hugo data, and records source provenance. The theme supplies accessible semantic presentation and the existing output pipeline. Ordinary Hugo then builds HTML, Print, Markdown, search, and agent indexes from those generated pages.
Start with operations, parameters, request/response bodies, and linked schema descriptions. After a parser prototype, explicitly declare supported OpenAPI versions and constructs. Unsupported constructs cannot disappear silently. Scope operation identity to the API/specification. If operationId is missing, the generator can derive a method/path key and warn about identity changes. Reused operationId values across different APIs must not collide.
Keep human-authored guides separate from generated facts. Generation must be deterministic, record source hashes and generator version, detect stale output, and refuse to overwrite unexpected human changes. Check generated source into the site, or supply it as a versioned build input, so rendering itself remains CLI-independent. Resolve remote references in an explicit preparation step. Normal generation must not follow arbitrary external URLs.
Acceptance requires a real user specification in addition to a toy example, complete accounting of supported operations, cyclic-reference handling, stable routes, semantic content in all selected outputs, and accessibility checks with no inherited Swagger/Redoc exclusion for the new static renderer. Measure a representative large specification before promising a throughput target.
Keep existing Swagger/Redoc integrations compatible. Interactive requests, credential handling, SDK generation, mock servers, and an API testing platform are outside this first compiler increment.
Architecture and compatibility rules
Keep CLI internals small: command handling, Hugo/process integration, diagnostics, template loading, and bounded file changes. Add migration and OpenAPI packages when their stages begin. This is a suggested decomposition, not a plugin ABI or public SDK.
Three boundaries need versioning: the CLI’s machine result format, the theme’s public schema/output contracts, and each supported migration/generation input profile. Prefer capability checks over a single “requires newest OINK” rule. A newer unsupported schema must produce a useful compatibility diagnosis.
The CLI cannot import a sibling theme’s private Python modules, depend on a local checkout layout, or download executable checks at runtime. Port selected consumer operations and test their behavior. Keep template-internal checkers in the theme, and make future changes to exposed consumer rules update their owning contract. Keep existing scripts available during the transition. Remove duplication only after the replacement covers supported cases.
No CLI configuration file is required initially. Hugo retains rendering configuration. If repeated usage later justifies a tool-policy file, it may hold ignored paths, rule severity, or a reviewed baseline, but must not mirror params.ui, navigation, languages, or module pins. A reviewed lint baseline cannot suppress a failed Hugo build, an unreadable input, or an unsupported required check.
Roadmap and staffing assumption
Stages 0 and 1 have a local first-stage candidate, with validation details in the acceptance record. The 8–12 week first-stage planning envelope below assumes roughly one full-time implementation owner plus part-time documentation/review help. Toolchain qualification, recruitment, and bilingual review take time; reduce scope before adding parallel work.
| Stage | Timing from approval | Deliverable | Exit evidence |
|---|---|---|---|
| 0: establish the boundary | Weeks 1–2 | Accept repository choice; collect failure examples; define result format and supported baseline; prototype read-only doctor/check against current 1.1.0 | Starter plus at least three varied real repositories; failures and coverage omissions recorded |
| 1: complete the daily workflow | Weeks 3–6 | Doctor/check, pinned init, thin dev/build; prospective single-site upgrade and file-preservation tests | New users can diagnose a seeded failure; ordinary Hugo still builds generated sites; no unexplained source changes |
| 2: release a bounded product | Weeks 7–12 | Proposed theme 1.2 + CLI 0.1; compatibility record; docs; qualified installation; limited Docsy migration assessment/pilot | First-run study and repeat upgrade use; migration limitations are explicit; published pins and consumer adoption checked separately |
| 3: validate migration and one content model | Months 4–6 | Harden the first migrator; choose version lifecycle or OpenAPI based on users; propose theme 1.3 / CLI 0.2 as needed | At least two real repositories use the chosen workflow; accepted contract precedes compatibility promises |
| 4: earn expansion | After month 6 | The other content capability, then optional recipes/provenance or agent transport where justified | Repeated use and maintenance capacity |
If stage 2 overruns, remove migration writing from that release and keep its assessment report. Do not cut upgrade preservation, truthful diagnostics, or independence from the CLI. If no independent team wants the migration profile, stop expanding framework coverage and investigate onboarding/positioning instead.
Freshness/ownership is a later optional quality feature, initially a report whose findings users actually act on. A modification date must never be presented as verification. Ship a handful of useful official page recipes before a registry. Graph G2/G3, MCP, analytics adapters, executable examples, Studio, and managed services each need a specific user problem and capacity decision; this roadmap assigns them no delivery dates. Existing static agent outputs make MCP less urgent than adoption.
Acceptance and product measures
| Area | Initial target or required property |
|---|---|
| First successful use | With prerequisites already installed, at least 4 of 5 unfamiliar target users reach local preview and a passing strict check within 15 minutes without maintainer intervention; Record cold installation separately |
| Maintenance value | At least three real sites use diagnosis/checks and repeat a supported upgrade; Every failure has an actionable report |
| Diagnostic precision | Triage all blocking findings in the pilot; aim for less than 5% false positives in an explicitly counted labeled sample |
| Integrity | Zero silent content loss; every migration input is accounted for; repeat transforms have no diff; user edits and unrelated dependencies survive |
| Independence | Initialized/generated sites build through ordinary Hugo with provisioned dependencies; optional CLI and output features remain optional |
| Offline behavior | Run the qualified local workflow with outbound access denied after provisioning; record cache misses and explicitly networked features separately |
| Compatibility | Current tested theme baseline and candidate release, pinned site regression toolchain, root/subpath, and EN/ZH cases |
| Adoption | Seek five independent pilot teams within the first stage, and track which reach production and continue using the result at 30/90 days |
Use independently maintained production sites as the main adoption measure, verified through public references or voluntary user confirmation. A stable documentation site should not stop counting merely because it has no commit in 60 days. Track theme upgrade recency separately from retention. Stars, download counts, internal consumer count, and agent-generated volume serve as supporting signals.
Track time to first local success, time to production, upgrade effort, and manual migration effort separately. Do not add default telemetry to obtain these measures.
Implementation ownership and validation
| Change | Owning validation |
|---|---|
| Tooling descriptor and schema compatibility | A focused theme descriptor check plus generate-config-schema.py --check and relevant parameter checks |
| Diagnostics exposed to consumers | Owning resolver/checker cases; CLI diagnostic result/exit-code tests |
| Existing output behavior | check-agent-indexes.py, output/security/navigation checks appropriate to the changed surface |
| Init and upgrade | CLI tests against pinned Starter snapshots and repositories with replacements, vendor content, unrelated dependencies, and dirty target files |
| Migration | Ported/extended transform cases, source-preservation and repeat-run checks; reviewed real-site route/content evidence |
| Future version/API presentation | Theme output checks plus bilingual documentation-site integration, browser, accessibility, responsive, and visual review |
Run the smallest owning check first. Public behavior changes still require implementation, checker, and both language contracts in one coordinated delivery. Use the sibling site’s make check, make browser, and make dev workflow for actual integration and visual acceptance.
For a release, separately record local checks, commits, tags, published module/binary resolution, consumer pins, and deployment. Theme release adoption continues through the maintained consumer inventory procedure. Use a coordinated issue/checklist to connect the repositories.
Open decisions and stop conditions
Repository selection and first-stage implementation are settled locally. Remaining release decisions include qualified platforms, the public distribution channel, compatibility claims justified by executed evidence, and independent pilot recruitment.
Result and exit semantics are frozen for the local candidate in the CLI contract. The minimal theme descriptor and stable theme warning identifiers remain separate proposals. Before a versioning beta, settle manifest projections, archive retention, and page correspondence. Before an OpenAPI beta, settle the supported spec subset and generated-source ownership.
Reconsider the separate CLI investment if pilots only need a tiny maintenance script, if rules must repeatedly duplicate template semantics, or if maintaining distribution consumes more effort than the measured user benefit. Keep successful standalone scripts in that case. If evidence changes, reorder versioning and OpenAPI. Do not expand the total concurrent scope.
Decision log and sources
| Date | Record |
|---|---|
| 2026-09-29 | Draft created from the supplied strategy research and local source review. Recommends a separate optional CLI, a small adoption release, bounded migrations, and sequential content capabilities. |
| 2026-09-29 | Subsequent user authorization accepted the independent Go repository and first-stage development. A local 0.1.0-dev candidate implements doctor/check/init/upgrade/dev/build. Stable behavior moved to the CLI decision and usage guide. Local acceptance passed for CLI commit e623d93. |
Local authorities consulted: Architecture, generated schema decision, migration boundary, version behavior, OpenAPI limits, and graph proposal status. The source inspection also covered theme bin/, schema/nav.v1.schema.json, the existing Starter, and documentation-site build/check commands.
External primary sources were checked on 2026-09-29: the linked Mintlify command reference, Nimbus repository, Docusaurus versioning guide, and Hugo config/module documentation.
13 - oink: preview and multi-version serving from a docs repository
This proposal describes a product direction that is not implemented. Do not use it as a configuration or command reference. Current behavior is defined by the architecture contract, the CLI contract and the versions guide.
Status and surface
Status and date: draft, 2026-11-28; product requirements and an architecture direction, not an implementation contract
Owner: OINK maintainer
Baseline: OINK v1.7.0; installed Hugo v0.170.1; the local 0.1.0-dev candidate of pgsty/oink-cli (unreleased, no users)
Affected contracts: CLI contract (superseded if this proposal is accepted), Architecture · Outputs and runtime, Shell · Search, actions, and runtime, Shell · Archived-version banner, versions guide
Related proposals: takes over the unimplemented version-lifecycle stage of the CLI roadmap; answers the open question of theme roadmap R2, “native version dimension or independent builds”; delivers the database backend that the local search proposal left open
Affected implementation: a new oink binary repository (see open decisions); the theme’s
version menu, banner, search, comments, sidebar and error pages (see
theme coordination)
Release intent: staged, see milestones; this proposal commits to no release date
Summary
Run the same oink binary in any OINK documentation repository:
The machine needs no Hugo, Go or Node. The binary embeds upstream Hugo (imported as a library, not forked) and the OINK theme.
The core model fits in one sentence: Git is the content store, a version is a label bound to a ref, and rendered output is a content-addressed snapshot. The production server publishes only committed, successfully built snapshots and moves version pointers atomically. Storage and computation grow with unique content, not with versions times pages.
Four invariants run through the whole document:
- Plain Hugo still builds the site. oink adds versions, serving and online features and never changes what a page means; without oink nothing breaks.
- Production serves only committed, successfully built snapshots. Half-edited files, bad commits and build timeouts never replace live content; the last good snapshot keeps serving.
- Appearance has one authority. Hugo and OINK render every byte of HTML, including error pages, version menu fragments and corpus shells. The server routes, splices declared slots and caches; it renders no templates.
- Cost follows unique content. A tag is built once, and an unchanged page is stored once.
Context and evidence
Current state
- OINK treats each documentation version as a separate site: built and deployed on its own, with the
params.versionsmenu written into every build. Adding a version means updating the list on every branch and rebuilding them all (see the versions guide). oink-cliis a local candidate that calls an external Hugo; it is unreleased and has no users. On 2026-11-28 the owner said the new design need not follow it.- Comments, page views, sign-in, access control and cross-version search have no home on static hosting; comments are giscus only.
Why per-version static builds explode
Measured on 2026-11-28 in the pgdoc-cn repository (the pgweb HTML of the Chinese PostgreSQL manual,
559 releases plus master) and on the bilingual PG 18 OINK site:
| Measurement | Result |
|---|---|
| Every version checked out | 6.15 GB of HTML in 529k files; the Git pack is 78 MiB |
| File-level deduplication | 527k unique files, almost none removed: each minor release touches about 1,000 files, most of them only for the version number in the page header and footer |
| Deduplication by body after stripping header and footer | 98k unique bodies, 1.29 GB |
| Pages that really change per minor release | median 107 (p90 333); about 35 on the 17 and 18 lines |
| zstd in ~1 MiB clusters sorted by path across versions | 31 MB of unique bodies; 73 MB for whole pages with headers and footers |
| Read one page from Git / turn it into an OINK body | p50 156 µs / p50 0.38 ms (p99 2.7 ms) |
| One OINK build (bilingual PG 18, v1.7.0) | 38 s, 4.2 GB peak, 808 MB; 431 KB per page on average, 55% of the SELECT page is sidebar |
| The site’s own vendored OINK v1.4.0 | fails to build on Hugo 0.170.1 |
The explosion has three sources: version-dependent chrome baked into every page, storage file by file, and OINK inlining the whole sidebar in every page. None of them is content. Without them all 560 versions take 30–70 MB, and materializing all of them in the background costs about one CPU minute. The last row also shows that an old version cannot be re-rendered with the theme it once used.
What Hugo already provides
- The whole command line is one function. Hugo’s
commands.Execute(args []string) erroris the entry point of a public package (v0.168.0 source,commands/commandeer.go); embedding Hugo’s CLI is one line. - Replacing the theme needs no Go. With no
goonPATH, pointinggithub.com/pgsty/oinkat a local directory throughHUGO_MODULE_REPLACEMENTSbuilds an OINK site completely; without the replacement Hugo stops withbinary with name "go" not found in PATH(measured on 2026-11-28 with Hugo v0.170.1). - Static compilation should work. In the v0.168.0 source, WebP and AVIF codecs run in WASM and cgo
serves only the removed LibSass; OINK is plain CSS, so a binary that embeds Hugo should cross-compile
with
CGO_ENABLED=0(not yet tried). - The sites matrix has a version dimension. Since v0.153,
[versions]configuration,sites.matrix.versionson mounts, andsite.Versionand.Rotatein templates form a native version dimension. It puts every version in one build, which suits small static sites; see alternatives. - The development server is already good.
hugo serverrebuilds incrementally, live-reloads and shows errors in the browser.
Owner inputs
These requirements come from the owner’s discussion on 2026-11-27 and 2026-11-28 and are the premise of this proposal. Everything else on this page is a proposal and binds nothing until the owner accepts it.
- One Go binary named
oink, in OINK style; local Markdown in Git is the only authoritative source. - It runs directly on a documentation repository: local preview with live updates while editing, and production serving.
- Production is Git-aware: it can pin one branch or publish a set of tags as versions; the default branch is the default version; in PG a major version is a branch and a minor version a tag; historical versions are read from Git and rendered on the fly.
- Building many static versions must not make the site explode.
- SQLite keeps state and the full-text index, with better full-text search, page views, comments and even access control.
- It is based on Hugo, embedded thinly, like the Hugo module inside Caddy.
- A
.oinkpackage format that the macOS app Crib opens directly. - First-round requirements: comments, users, access control, full-text search, page views and versions; covering pg.center and pgext; 500+ PG documentation versions; Cloudflare preferred; images may come from nginx.
- The existing
oink-climay be disregarded, and the requirements themselves may be improved.
Goals and non-goals
Goals:
- G1 One binary. Running
oinkin any OINK repository previews it without Hugo, Go or Node; the same binary is the production server. - G2 Git-aware versions. Versions come from branches and tags; aliases such as
currentandlatestmove atomically; all 560 versions of pgdoc-cn are available. - G3 No explosion. Storage and build cost follow unique content; the store for every pgdoc-cn version stays under 100 MB.
- G4 No outage from edits or bad commits. Production follows commits only, keeps the last good snapshot, and rolls back in about a second.
- G5 One experience. A commit looks and behaves the same in
hugo,oink dev,oink serveand a.oinkpackage; every version shares the current appearance. - G6 Optional online features. Full-text search, page views, accounts, access control and comments run on SQLite, are off by default and are enabled per site.
- G7 Offline and distribution. One
.oinkfile opens directly inoink serveand in Crib.
Non-goals for the first version:
- No visual CMS, in-browser editing or Git commits from the web.
- No Hugo fork, and no new rendering engine or template language.
- No multiple sites per process and no state shared across instances; a PostgreSQL state backend can come later.
- No built-in TLS certificate issuance; run behind Cloudflare, nginx or Caddy.
- Version slots and online features are not supported for non-OINK themes (such sites build, but are out of scope).
- No reconstruction of the theme an old tag once used.
Users and scenarios
| Role | Scenario | Expectation |
|---|---|---|
| Authors and translators | Writing in the repository | Run oink, refresh on save; warnings appear in the page with file and line |
| Maintainers | Publishing a version | A new tag goes live automatically; a bad commit never reaches readers; one command rolls back |
| Operators | Deploying and upgrading | One binary and one data directory; serving resumes immediately after a restart; upgrades need no downtime rebuild |
| Readers | Reading and finding | Switching versions stays on the same page; old versions carry a clear banner; search and comments work |
| Offline readers | Crib or an air-gapped network | One .oink file opens every version |
What each target site uses:
| Site | Shape | Main capabilities |
|---|---|---|
| PG documentation on pgsql.cc | 560 versions of pgweb HTML | HTML corpus renderer, lines and aliases, cross-version search, .oink package |
| Product docs such as Pigsty | one line per minor release | Hugo renderer, default version at the root, comments |
| pgext | one version, about 10,000 pages | atomic publishing, server search, page views |
| pg.center | dynamic Go and PG application | oink serve for the documentation part; embedding as a Go library later |
Product shape
Commands
| Command | What it does |
|---|---|
oink |
oink dev inside a site directory; help elsewhere |
oink dev [DIR] |
Preview the working tree: refresh on save, drafts shown, localhost only by default |
oink serve [DIR | GIT-URL | FILE.oink] |
Production: publish versions from Git refs, or serve one package read-only |
oink build [--versions] [-o DIR | FILE.oink] |
Export a static tree or a single-file package |
oink check [--versions] |
Build and summarize Hugo and OINK diagnostics with CI-friendly exit codes |
oink versions |
List the versions, aliases and refs resolved from Git without building |
oink new [site | page] |
Create a site or page skeleton |
oink status, rebuild, rollback, user |
Manage a running server through a local socket in its data directory |
oink hugo … |
Run the embedded Hugo command line unchanged |
oink --version |
Print the versions of oink, the embedded Hugo and the embedded theme |
Development mode
- The source is the working tree, uncommitted files included; drafts and future-dated pages show;
it listens on
127.0.0.1by default. - The engine is Hugo’s own development server. oink runs the embedded
hugo serverin a child process (render to memory, incremental rebuilds, live reload) and reverse-proxies it, adding three things:- an in-page diagnostics overlay, so Hugo and OINK warnings appear with file and line in the page and not only in the terminal;
- the same
/_oink/endpoints as production, so search, comments and the rest can be tried against a localstate.db; - other versions from Git on request (
--versions), so the whole site with its version menu can be seen locally.
- No blank page on failure. A failed rebuild keeps the last good page, and the overlay points to the error.
- Folder mode (a later milestone): a directory without Hugo configuration gets a generated temporary
configuration and the embedded theme,
README.mdbecomes the section index, and the folder structure becomes the sidebar.
Production mode
- It reads Git and never the working tree. A half-edited file can never reach production; that is the fundamental guarantee that editing a file cannot crash the site.
- It serves at startup. Snapshots in the store are usable immediately and nothing rebuilds at boot. Only a change of engine identity (the oink, Hugo or theme release) rebuilds, in the background and one version at a time.
- It accepts three inputs: the current checkout (using its
.git); a remote repository URL (mirrored into the data directory); or a.oinkpackage (read-only, no builds). - It keeps following refs: resolve versions, build missing snapshots in the background, switch
atomically after success;
oink status,oink rollbackandoink rebuildhandle status, rollback and rebuilds.
Static and packaged output
oink build is serve frozen into files: the same snapshots and the same slot splicing.
oink buildbuilds the default version intopublic/, used likehugo.oink build --versions -o dist/writes a static multi-version tree: each version under its prefix, version slots spliced at export time, aversions.json, and aliases as_redirects. It suits sites with few versions and static hosts such as Cloudflare Pages.oink build --versions -o site.oinkwrites a single-file package; see content store and the .oink format.
Core model
| Concept | Definition |
|---|---|
| Source | A Git repository; in development mode, the working tree |
| Version | A label bound to a ref: 3.7 → v3.7.2, devel → main |
| Line | Releases of one series; 17 contains 17.0 to 17.12 |
| Alias | A movable pointer to a version: current → 18 |
| Skin | The ref that supplies configuration, layouts, assets and the theme release; by default the default branch |
| Renderer | Turns skin plus one version’s content into files: hugo or html |
| Snapshot | One version rendered at one commit: an immutable manifest from paths to objects |
| Store | Content-addressed object clusters; rebuildable; its format is .oink |
| State | Accounts, sessions, comments, counters and access rules; not rebuildable, back it up |
Versions from Git refs
- Without configuration, the head of the default branch is the only version, served at
/. Pinning a branch is this case, or--refchooses one. tagsis a regular expression with the named groupslineandpatch. Each line becomes a version labeled with itsline, whose content is the tag with the highestpatch. Withreleases: true, every tag also becomes an exact release such as17.4.branchesmaps labels to branches, for moving versions such asdevelornext.- Line content comes from the newest tag by default;
line_branchpublishes the head of the line’s branch instead, for translation projects that ship corrections between releases. aliasesmaps names to versions or to the computed targetlatest, the highest-numbered line.defaultnames the version served without a version prefix;archivedmarks lines that are no longer maintained.- Ordering compares dotted numbers component by component; tags that do not match the expression
(such as
v4.0.0-rc1) are not published.
Product documentation: one line per minor release, default version at the root.
The Chinese PostgreSQL manual: two version-number styles, 560 versions.
| URL | Meaning |
|---|---|
/docs/17.4/sql-select.html |
Exact release, immutable, noindex |
/docs/17/sql-select.html |
The newest release of line 17 |
/docs/current/sql-select.html |
Alias of the highest-numbered line, served in place |
/docs/devel/sql-select.html |
Head of master, noindex |
Content per version, current appearance
When the Hugo renderer builds a version, it takes content/ (and any other path listed in
versions.content) from the version commit and everything else from the skin commit:
hugo.yaml, layouts/, assets/, i18n/, data/, static/, go.mod and the theme release. The
worktree’s HEAD is the version commit, so each page’s last-modified date and author belong to that
version and not to the skin.
There are four reasons:
- An old theme may not build on a new Hugo (v1.4.0 already fails on 0.170.1).
- Navigation, the version menu and search look the same in every version, so switching versions never lands the reader on a different site.
- One deployment has one theme release, so fixes and improvements reach every version at once.
- Templates come only from the skin; old tags and preview branches contribute content and never run templates of their own.
The cost: configuration differences of old versions (menu entries, parameters) no longer apply, and old
content that uses a removed shortcode warns and degrades safely under the theme’s rules.
oink check --versions reports these warnings per version. A version that really needs its own
configuration can set skin: self and build with its own configuration, layouts and theme release; if
that fails on the embedded Hugo, the version is unavailable and its status says why. Docusaurus works the
same way: documentation content is versioned, the theme is always current.
When a skin commit changes only content paths, only its own version (usually devel) rebuilds. When it
changes configuration, layouts or assets, the other versions rebuild in the background while their old
snapshots keep serving.
URLs, canonical links and indexing
- The default version is served without a version number. Adopting versions changes no existing URL.
/v{default}/xanswers 301 to/x. - Other versions live under the prefix of the
urltemplate,/{label}/by default. The Hugo renderer’s prefix must start at the site root because the whole build is relocated; an HTML corpus can be mounted under any prefix, such as/docs/{label}/. - Aliases are served in place when the output is location-independent (HTML corpora are now; Hugo output will be after the theme delivers T10), and redirect with 302 otherwise.
- Canonical links: a page in a non-default version points
canonicalat the same page in thecanonicalversion (by defaultdefault;currentin the PG example), or at itself when that page does not exist. The PostgreSQL and Python documentation both do this (pages ofdocs/16and3.11checked on 2026-11-28). The server rewrites the link while serving, which needs theme item T5; until then the canonical link points at the page itself. - Indexing: exact releases and prerelease versions carry
noindex(through the build-level parameter of T4); the sitemap lists the default version only. - Version-aware 404: when a path does not exist in a version, that version’s own 404 page is
returned, and the theme runtime calls
/_oink/whereto list the versions that have the path, such as “since 9.4” or “removed in 12” (this needs T3 and T8).
Architecture
Pipeline
- Resolve: read the
oink.yamlcommitted on the skin ref and map refs to versions and aliases. Each version’s snapshot key is H(version commit, skin commit, engine identity, URL base); an existing key means there is nothing to do. - Materialize: the Hugo renderer creates a
git worktreeat the version commit and overlays the skin’s files; an HTML corpus is not materialized and its pages are read straight from Git objects. - Render: run the embedded Hugo in a child process into a temporary directory; transform HTML corpus pages one at a time.
- Ingest: hash every output file and write only new objects into clusters; record the byte offsets of slots in HTML; extract search records; write the manifest.
- Publish: once the snapshot is complete and its checks pass, switch the version pointer in one SQLite transaction; optionally ask the CDN to purge by prefix.
- Serve: find the version and snapshot from the URL prefix, read the object, splice version slots and answer with the cache policy.
Rendering engine
- Embed Hugo’s command line.
oinklinks Hugo’scommandspackage, andoink hugo …is stock Hugo. Builds re-execute the binary as a child process (oink hugo --source … --destination …). The coupling to Hugo is its command-line flags and output directory only, never the unstablehugolibinternals. - Why a child process. One PG 18 build peaks at 4.2 GB; inside the long-running server, one OOM or hang would take the service down. A child process has a timeout, a memory limit, a concurrency limit and a lower scheduling priority, and returns all of its memory when it exits.
- Theme injection. The embedded theme is extracted into a cache directory keyed by release and
checksum, and the child runs with
HUGO_MODULE_REPLACEMENTS="github.com/pgsty/oink -> <dir>",GOWORK=offandHUGO_MODULE_WORKSPACE=off. This is verified to need no Go. - The theme release follows the skin’s
go.mod, as with plain Hugo. It is sourced, in order, from the embedded theme when the release matches, the site’s_vendor/, a local cache, or a download from the Go module proxy verified againstgo.sum(forbidden with--offline). Other Hugo modules likewise come from_vendor/or the cache; otherwise oink reports a clear error. - Build security. Published refs build under the site’s own Hugo
securityconfiguration; preview refs always build under a tightened one: noexec, nogetenv, no remote HTTP, and no inline shortcodes. Child processes receive only the environment variables a build needs, and never a secret. - Incremental work. The first version is incremental at the store level: only changed versions rebuild and only changed objects are stored. Hugo-level incremental rebuilds (a warm Hugo fed Git diffs as file-change events) wait for measurements.
Two renderers
hugo (default) |
html (HTML corpus) |
|
|---|---|---|
| Input | One ref of an OINK or Hugo site | A rendered HTML tree, such as the DocBook output in pgdoc-cn |
| Granularity | One build per version | Per page, on first request or during background warm-up |
| Page chrome | Complete pages built by Hugo | A theme-rendered shell template plus the transformed body |
| Measured cost | 38 s and 4.2 GB for one bilingual PG 18 version | 0.38 ms per page (p99 2.7 ms); about one CPU minute for 98k bodies |
| Aliases | 302; in place once the theme delivers T10 | In place |
The HTML corpus renderer follows a built-in profile: how to find the body and title, which of the original
chrome to drop, how to rewrite internal links to the version prefix, how to map admonitions and tables to
the markup of theme components, and how to derive the navigation tree from the table of contents. The
first version allows no user scripts, and profiles start with pgweb. Transformed bodies are
location-independent and can sit unchanged under any alias.
Content store and the .oink format
The store is one SQLite file, and the production cache, distribution packages and Crib’s reading source all use this one format:
- The writer carries the complexity; a reader only fetches bytes by path. The read path is path → entry → object → cluster (decoded clusters stay in an in-memory LRU) → bytes.
- Append while serving, compact before distributing. A running server appends new objects to new
clusters;
oink build -o x.oinkreorders them so that the versions of one path sit together, packs them, and can add an Ed25519 signature. - Measured size: 31 MB for every unique pgdoc-cn body, and only 73 MB even for whole pages with headers and footers; decoding a 1 MiB cluster takes 0.3–0.43 ms at p99.
- The codec is recorded per cluster. Apple’s Compression framework has no zstd and Crib has no third-party dependencies. Either Crib adds a decode-only libzstd, or packages built for Crib use a codec Apple ships; measure first, see open decisions.
- State never enters the store.
store.oinkcan be deleted and rebuilt at any time;state.dblives and is backed up on its own.
Serving and caching
A request goes through: dispatch of /_oink/ endpoints → longest-prefix match of a version or alias (no
prefix means the default version) → access check → pinning the snapshot this request uses → entry lookup.
A hit is answered; a miss goes to the version-aware 404; a version not built yet returns a theme-rendered
503 “building” page with Retry-After.
Slots come in two kinds:
- Version slots are spliced by the server and cacheable: the version menu, archived or prerelease
banners,
canonicalandrobots. They depend only on which version this is and which versions exist, so every anonymous reader gets the same bytes and a CDN can cache them. - Reader slots are filled in the browser and never cached: sign-in state, comments, page views, and
the versions that contain this page. The theme runtime renders them from
/_oink/JSON endpoints; cached HTML never carries anything personal to a reader.
Version slots arrive in two stages:
- Stage one changes nothing in the theme. Each Hugo version is built with existing parameters
injected:
params.version,params.versions,archived_versionandurl_latest_version. When the set of versions or the skin changes, every Hugo version rebuilds in the background. For a site with a few dozen versions that is minutes of background CPU. - Stage two takes slots from the theme (T5). Pages carry empty
<template data-td-slot="…">markers. When the set of versions changes, oink runs a small fragment build of the skin: no content, plus one page per version generated by a content adapter, reusing the theme’s existing version-menu and banner partials. It writes each version’s menu and banner, and the shell template for HTML corpora. The server splices those bytes at the offsets recorded during ingest and renders no templates. Sites with many versions need this stage; HTML corpora use fragments and shells from the start.
| Response | Cache-Control |
Invalidation |
|---|---|---|
| Fingerprinted assets (CSS, JS chunks, fonts) | public, max-age=31536000, immutable |
The file name changes with the content |
| HTML of releases and lines | public, max-age=300, s-maxage=86400, with ETag |
Purge the CDN on a release or skin change |
HTML of moving versions such as devel |
public, max-age=60, s-maxage=300, with ETag |
Purge on each publish |
/_oink/versions.json |
public, max-age=60 |
Expires naturally |
Other /_oink/ endpoints and protected pages |
private, no-store |
Never cached |
The ETag combines the object hash and the slot generation. A media mount serves a directory outside Git
under a prefix, unchanged, with Range requests and long caching, and never enters the store; large images
and video can also stay on nginx or R2.
Updates, failures and rollback
- Triggers: a periodic
git fetch(every 60 s by default); a webhook (POST /_oink/hooks/<provider>, verified by HMAC); or a bare repository on the server used as a push target, whose refs are watched directly. - Queue: the default version first, then lines by traffic; concurrency 1 by default; a newer commit of a version replaces its queued build.
- Atomicity: each request pins its snapshot when it starts; the pointer switches only after the new snapshot is complete and its checks pass.
- Failure: a failed, timed-out or rejected build keeps the old snapshot, and the status records the commit, the log tail and the number of warnings; an outgoing notification is optional.
- Retention and rollback: moving versions keep their three latest snapshots, and
oink rollback <version>switches back in about a second; garbage collection removes objects no longer referenced, then clusters are compacted. - Upgrade: replace the binary and restart; existing snapshots serve immediately, and a changed engine identity rebuilds in the background, version by version.
- Crash safety: both SQLite files use WAL; after
kill -9and a restart, no published snapshot is lost.
Search
- Data: ingest writes one record per unique body (title, headings, text, language) and notes the versions it belongs to. The Hugo renderer reuses the fields of the theme’s local search index first, so both backends search the same text.
- Engine: SQLite FTS5 with BM25. CJK text is pre-segmented in Go, aligned with the theme’s local engine
and with Crib’s
pgdash-han2-v1analyzer, so FTS5 needs onlyunicode61and no custom tokenizer. - Scope: the current line by default; optionally every version, with results merged per page and labeled with versions. pgdoc-cn indexes 98k bodies, not 529k pages.
- Access: results are filtered to what the reader may see.
- Interface: the theme’s search interface stays, with
/_oink/searchas its backend; static hosts keep the local engine.
Accounts, access, comments and page views
- Accounts: OAuth/OIDC sign-in, GitHub first; sessions live in
state.db.oink user add --admincreates the first administrator and prints a one-time sign-in link in the terminal, so no mail service is needed. - Access:
oink.yamlgrants roles by path and version. Protected content never enters the CDN, never appears in other readers’ search results, andoink buildrefuses to export it. - Previews: previews of branches, pull requests or arbitrary commits are for maintainers only and are served from a separate host name that has no session cookie of the main site.
- Comments: keyed by page identity (mount, language and path within the version, with Hugo
aliasescovering renames), shared across versions by default and labeled “written on 3.7”; a Markdown subset is sanitized on the server; a new user’s first comment waits for review, and the endpoints are rate-limited. giscus stays the option for static sites. - Page views: each page load sends a
sendBeaconto/_oink/hit; no cookie and no IP address are kept; counts accumulate in memory and are written per day every minute; whether they are shown is a theme parameter.
Configuration
Two files, one job each:
hugo.yamldecides how pages look and behave, including the comment provider, the search backend and whether page views are shown.oink.yamldecides what is published where, plus server policy: versions, skin, renderers, access, moderation and media directories. It must not setparams.ui.*; oink reads the effective configuration through the embedded Hugo to decide which services to run.
Production reads the oink.yaml committed on the skin ref, so a change of publishing policy is also
reviewed and committed. Secrets come only from environment variables; deployment settings such as the
listen address and data directory can be overridden on the command line.
Output, accessibility and security boundaries
- Output: HTML stays semantic-first and progressively enhanced. The server splices the version menu
and banners, so they work without JavaScript; reader slots are absent without JavaScript and the page
stays complete. Print, Markdown and LLMS outputs are generated per version, and
llms.txtlists the versions; RSS comes from the default version only. - Accessibility: new interface (the dynamic form of the version menu, banners, sign-in, comments, page views, error pages) follows the theme’s component rules, has strings in all 32 locales, and passes the documentation site’s axe checks.
- Build isolation: production builds only refs that match the configuration; previews are served from a separate host name and built under the tightened policy; child processes have timeouts and memory limits.
- Sessions and endpoints: cookies use the
__Host-prefix withHttpOnly,SecureandSameSite=Lax; write endpoints checkOrigin; comments are sanitized on the server; the server sets the CSP. - Management: management commands use only the local socket in the data directory;
/_oink/metricsis open to localhost or administrators only. - Privacy: page views collect nothing that identifies a person and use no cookie.
Theme coordination
To give one site the same experience in plain Hugo, oink dev, oink serve and a .oink package, the
theme has to make the changes below. “Today” comes from a read-only survey of the theme’s working tree on
2026-11-28; paths are relative to the theme repository root. Under the theme’s rules, each item ships with
its owning checker, strings in all 32 locales and the bilingual contract. Stage one depends only on
T1–T4; with version slots (T5), a new release no longer rebuilds old versions.
Before stage one (M1–M2)
- T1 An embeddable theme module. Today: the root has no Go file, and
go.moddeclaresmodule github.com/pgsty/oinkwithgo 1.27.4. Change: add anembed.goof a few lines that exports the module files as anembed.FSwith//go:embed all:layouts all:assets …. The binary takes the theme from the same module zip Hugo downloads, the binary repository keeps no second copy, and plain Hugo users see no difference. - T2 The cost of the sidebar and pager. Today: the sidebar is rendered into every shell page; at
sidebar_cache_limit(500 pages) the whole tree ispartialCachedand its active row is set in the browser. The sidebar’s share of page bytes measured 31% on oink.pgsty.com (51 KB of 163 KB) and 63% on pigsty.io (203.5 KB of 313 KB, a build from 2026-11-13).pager-state.htmlscans the whole reading sequence for every page. Change: publish the full navigation tree once per version as a fingerprinted file, inline only the current branch in each page, and compute prev/next from one precomputed index. Builds get faster and lighter, unchanged pages become byte-identical across versions so store deduplication actually works, and the roughly 10,000-page pgext depends on it. - T3 Error and status pages. Today: only
404.htmlexists; in production it saysindex, follow, and it carries no archive banner. Change: add 401, 403 and 503 (building) templates, allnoindex, and give the 404 page a reader slot where the runtime lists the versions that have the path. Every page the server returns is rendered by the theme. - T4 Per-version edit links and indexing control. Today:
actions/page-urls.htmlbuilds edit and history links fromgithub_repoandgithub_branch(defaultmain), and the branch can be set per site, section or page; the robots meta tag depends only on whether the build is production (head.html) and has nonoindexparameter; shortcut preferences and reading history are partitioned by the path ofbaseURL(scripts.html,shell/history-dialog.html). Change: oink injectsgithub_branchper version (the line branch or the default branch), and the theme offers a switch that hides edit links for tag-only versions; add a build-levelnoindexparameter; partition local storage by site instead of version prefix, so readers keep preferences and history across versions.
Stage two (M3–M4)
- T5 Version slots and fragments. Today: the version list is written at build time into the navbar,
drawer and footer (
navbar.html,navbar-version-selector.html,shell/footer-line.html) and into the command-palette JSON of every page, about 9 KB each (actions/context.html); the active entry and the path appended byversion_menu_pagelinks(content/version-url.html) are decided at build time too.canonicalis always.Permalinkwith no override (seo-alternates.html). At 500 pages,sidebar-nav.jsfinds the active sidebar row fromlink[rel="canonical"], which breaks as soon as the canonical link points at another version. Change: mark the version menu, banners (404 included) andcanonicalwith<template data-td-slot>and add fragment layouts that render on their own; have the palette and theVkey read their options from the same fragment data; locate the sidebar’s active row from the page’s own URL; stop opening a new tab for an archive-banner link within the site. On static hosts the runtime fills the same slots fromversions.json. - T6 A search backend. Today: the local index is the resource
offline-search-index.<lang>.json, with bodies split into a separate file above 2 MiB, and the page gives its base-prefixed path indata-td-index-src. There is no server backend:initSearchacceptssearchApi, but the palette initializes itself, andregisterSearchTailaccepts only synchronous rows. Change: add a configured server backend (/_oink/search) with the local engine’s result shape, version scopes, and CJK segmentation that matches the server. oink reads each version’s local index files during ingest, so both backends search the same text. - T7 A comment provider. Today:
comments.typesupports onlygiscusand warns on anything else (comments.html,comments-state.html); giscus maps threads bypathnameby default, so one page splits into separate discussions under different version prefixes. Change: add anoinkprovider that renders a reader slot in the theme’s own styles, and give giscus a version-independent page key on multi-version sites. - T8 The reader-slot runtime. Today: there is no sign-in, user menu or page-view component, and the
only analytics integration is Google Analytics. Change: add one stable
js/chunks/target, loaded only on pages with oink services enabled, for sign-in state, page views and the versions that contain the page; every new string goes into the 32 locale files. - T9 Corpus shells and body markup. Today: none. Change: provide a shell layout from which the fragment build writes whole-page shells with slots, and publish the body-markup contract that the HTML corpus renderer must emit (admonitions, tables, code blocks), so transformed bodies get theme styles directly. Until then the M0 prototype cuts its shell from one built OINK page.
Later
- T10 Location-independent output. Today: the theme tests subpath deployment (several checkers use
/preview/as the base), has no hard-coded root-relative paths and uses relative paths in CSS; butcanonical, hreflang, taxonomy-term links and share and copy links use absolute.Permalink, PlantUML and ReDoc chunks embed URLs at build time, NAVJSON and LLMS emit absolute addresses, andrelativeURLsis unsupported. Change: let one output serve under any prefix, so aliases of Hugo versions can be served in place. Until then aliases use 302, and stage one is unaffected. - T11 Per-version machine outputs. LLMS, NAVJSON and BookManifest carry absolute addresses and
baseURL, so building them per version is enough;llms.txtgains a version list so that agents can find the other versions. - T12 Hugo’s native version dimension. The theme uses neither
site.Version,.Rotatenor a versionedsites.matrixtoday. Whether small static multi-version sites get the native dimension is theme roadmap R2’s decision; this proposal’s slot contract should stay compatible with it.
Process coordination
- Release order: the theme is tagged → an oink release embedding it ships → sites update
go.mod→ deployments upgrade oink. The post-release adoption flow (update-consumers.py) gains a step: sites that useoink serveupgrade the binary too. - Contract ownership: slots, fragments,
versions.jsonand the corpus body markup are public theme contracts, written into the bilingual Design contracts with a version; oink detects the skin’s theme release and falls back to stage one when slots are unsupported. - Configuration boundary: the binary repository generates the schema of
oink.yamlfrom its own types, outside the theme’sschema/site-params.schema.json;params.ui.*stays inhugo.yamlonly. - Checkers:
check-shell.pyverifies slot markup and fragment layouts,check-goldens.pyrecords the new HTML structure,check-i18n.pykeeps the 32 locales identical, and the documentation site runs its browser suites throughoink serve.
Compatibility and migration
- Sites that do not use oink are unaffected. The theme repository stays a pure Hugo module with no server code, and plain Hugo builds produce the same output.
- Multi-site deployments that use
params.versionscan stay as they are. After moving tooink serve, stage one has oink injectparams.versions; a hand-written list in the repository is overridden with a warning. - Existing URLs stay. The default version is served at the root; old versions that lived on subdomains can answer 301 to their new prefixes.
- The
oink-clicandidate retires. Its still-useful checks (links, translations) move tooink check; theoink.result/v1result format, which has no users, is not kept. If this proposal is accepted, the CLI contract is marked superseded, and the version-lifecycle and platform stages of the CLI roadmap retire with it. - Revising an accepted decision. The CLI contract requires calling an external Hugo, importing no private Hugo runtime, and creating no second route or navigation authority. The new design embeds Hugo’s public command line, and routing and rendering inside one version still belong to Hugo; oink adds only two authorities: the version dimension and the import of external corpora.
- Crib: the
.cribformat does not change; Crib gains a reading mode for.oink, see milestone M5.
Implementation and checker plan
- Binary repository: the new
oinklives in its own repository (reusepgsty/oink-clior create one; see open decisions). A rough package split:engine(embedded Hugo, theme injection, child processes),gitsrc(ref resolution, worktrees, object reads),render/hugo,render/html,store(.oink),serve(routing, slots, caching),search,state(accounts, comments, counters) andadmin. - Theme repository: implement the items of theme coordination in priority order, each delivered with its owning checker and bilingual contract.
- Documentation site: once this proposal is accepted, add an
oinkuser guide and contract page;make browsergains a Playwright suite whose pages are served byoink serve. - Checkers: Go tests in the binary repository cover parity with plain Hugo output, a pgdoc subset
benchmark, recovery after
kill -9, ETags and cache headers, and access that does not leak; on the theme sidecheck-shell.py,check-goldens.pyandcheck-i18n.pycover the new markup and strings.
Milestones
| Milestone | Scope | Exit evidence |
|---|---|---|
| M0 prototype (about 2–3 weeks) | oink serve --git pgdoc-cn: HTML renderer, versions and aliases, store, FTS; the shell temporarily taken from one OINK page |
All 560 versions reachable; store under 100 MB; latency targets met; no theme change |
| M1 single binary | oink dev, build, check, hugo; embedded theme (T1) |
A machine with only oink and git previews and builds this documentation site, matching a build with the same Hugo release |
| M2 versioned serving | Hugo renderer, oink.yaml, atomic publishing, last good snapshot, rollback, status, webhooks; stage-one version interface; theme T2–T4 |
A site with five or more tags goes live; bad commits stay out; recovery after kill -9; the version menu matches the static build |
| M3 search and slots | FTS5, page views, version slots, corpus shells; theme T5, T6, T8, T9 | A new release needs no rebuild of old versions; server search agrees with the local engine at the agreed rate |
| M4 accounts and comments | OAuth, roles, access, comments, preview host name; theme T7 | Protected content never reaches caches, other readers’ search or exports |
| M5 packages and Crib | .oink compaction, signatures, oink serve x.oink, Crib reading mode |
Byte-identical round trip; Crib opens every pgdoc version |
Acceptance criteria
- On a machine with only
oinkandgit,oink devpreviews this documentation site andoink buildproduces the same output as plain Hugo with the same Hugo release and theme release (build timestamps aside). oink serveserves pgdoc-cn: all 560 versions resolve; the store stays under 100 MB; serving starts within 2 s of a cold start; origin p99 latency stays under 5 ms on a hit and 10 ms on a cluster miss, and under 20 ms for the first transformation of a corpus page; the server’s resident memory stays under 512 MB, build children excluded.- After a new tag is pushed, its build starts within 90 s when polling and within 10 s with a webhook, and the pointer switches atomically after success; no page mixes old and new content around the switch.
- On a Hugo site, a bad commit, a build timeout and
kill -9neither replace nor lose a published snapshot;oink rollbacktakes effect within 1 s. - The same version menu renders identically from a static
params.versionsbuild and fromoink serve(golden comparison); the documentation site served byoink servepasses the EN/ZH, desktop/mobile, light/dark and axe checks. - On a fixed corpus, the top ten results of server search agree with the theme’s local engine at the agreed threshold, Chinese queries included.
- Protected paths are invisible to anonymous readers and absent from the CDN cache, search results and
oink buildoutput; the preview host name carries no session cookie of the main site. - After
oink build -o x.oinkandoink serve x.oink, every URL returns the same bytes as the original server.
Risks
| Risk | Mitigation |
|---|---|
| Hugo’s command line or output changes across releases | Pin the embedded Hugo; CI also runs the latest Hugo; the coupling is only flags and the output directory |
| Binary size (about 87 MB for Hugo, 36 MB of theme files) | Ship compressed archives; if needed, a slim build that downloads the theme on first use |
| Stage-one full rebuilds are too slow | Concurrency and priority control; an external sidebar (T2) shortens builds; stage-two slots (T5) remove these rebuilds |
| Old content warns a lot under the current appearance | oink check --versions reports per version; skin: self for an individual version when needed |
| The slot contract and the theme release disagree | Version the slot contract; oink detects the skin’s theme release and falls back to stage one when unsupported |
| Online features expand the scope | No accounts or comments before M2; each feature is off by default and enabled on its own |
| Previews of untrusted branches | A separate host name, the tightened build policy, content only and never templates |
Alternatives
| Alternative | Conclusion |
|---|---|
| Static builds per version (the mike and Read the Docs approach) | Storage explodes (6.15 GB raw for pgdoc-cn; 808 MB per OINK version); old themes fail on new Hugo; the version menu forces full rebuilds |
| Hugo’s native version dimension with every version in one build | Build cost and memory grow with versions times pages, 560 versions are not feasible, and every new tag rebuilds all versions; it suits small static sites and belongs to theme roadmap R2 |
Forking Hugo, or calling hugolib in-process |
A fork is costly to maintain; hugolib is not a stable API; in-process builds bring memory peaks and crashes into the server |
| A CMS that keeps everything in a database | Loses Git and Markdown as the authority, and the review workflow with them |
| Running Hugo per request to render one page | Hugo needs the whole site graph to render a page and cannot work page by page |
| Cloudflare Pages with Functions and D1 or Hyperdrive | Multi-version static trees hit per-deployment file limits; build time is limited; online features scatter across Workers. Keep Pages as a static target of oink build and Cloudflare as the CDN in front of oink serve |
.oink as tar.zst, ZIP, a Git pack, or a custom ZIM-style binary |
tar has no random access; ZIP compresses per file and is 12 times larger than clusters; a Git pack makes every reader implement Git and rendering; a custom binary needs its own parser and remains a second-stage option for remote Range reads |
Open decisions
The default recommendation is in parentheses. Without an answer from the owner, the prototype proceeds on the recommendation, which does not count as acceptance.
- On acceptance, formally supersede the CLI contract and the related CLI roadmap stages, and retire the
oink-clicandidate? (Yes) - Put the binary in the existing
pgsty/oink-clirepository or a new one? (Reuse and rename it, keeping history) - Is the default skin the head of the default branch or the newest release tag? (The default branch)
- Canonical links: do old pages point at the same page in the default version (this proposal) or at themselves (the CLI roadmap draft)? (The default version)
- Is the default version served without a version number, or does every version carry a prefix? (Without)
- Does line content default to the newest tag or to the head of the line’s branch? (The newest tag; translation projects can switch to the branch)
- Are comments shared across versions or kept per version? (Shared and labeled with the version)
- Does the theme release strictly follow
go.mod, or may the embedded theme override it? (Strictly) - The
.oinkcodec: zstd with a decoder in Crib, or a codec Apple ships for packages built for Crib? (Measure first) - Does the first version support only a SQLite state store? (Yes; a PostgreSQL backend waits until pg.center needs several instances)
- Does
oinkwithout a subcommand meanoink devin a site directory? (Yes) - Should the theme support Hugo’s native version dimension for static users? (Outside this proposal; theme roadmap R2 decides)
Decision log
| Date | Record |
|---|---|
| 2026-11-27 | The owner sets requirements for an online form: comments, users, access control, full-text search, page views and versions, covering pg.center, pgext and 500+ PG documentation versions, with Cloudflare preferred |
| 2026-11-28 | The owner proposes the oink binary, a Git-aware production mode, SQLite, .oink packages and Crib; deduplication, packing and rendering are measured on pgdoc-cn and the PG 18 site |
| 2026-11-28 | The owner says the existing oink-cli need not constrain the design and the requirements may be improved; this proposal is drafted |
14 - OINK CLI maintenance roadmap
This dated requirements record preserves the original R1–R8 planning scope and anchors. Current CLI behavior belongs to the CLI contract and CLI introduction, and historical acceptance evidence belongs to the 2026-10-04 supplement. Conditional extensions E1–E4 remain inactive.
The proposed product should complete documentation maintenance before adding a local visual interface. It should help maintainers check changes, understand their effects, review safe modifications, and publish the exact artifact that passed checks. Studio should expose those same capabilities.
| Record | Value |
|---|---|
| Status | Implemented locally for R1–R8 and A18 |
| Owner | OINK maintainers |
| Date | 2026-10-03 |
| Baseline | Local CLI 0.1.0-dev, commit e623d93. Hugo Extended 0.166.0 and Go 1.27.1 on macOS arm64 |
| Completion scope | R1–R8 and the acceptance cases below. Conditional extensions have separate entry criteria |
| Affected surfaces | CLI command/result contract, Starter projection, consumer CI, translation policy, maintenance operations, local Studio, EN/ZH guides |
| Schedule assumption | One full-time developer with scheduled documentation and review support |
Background and evidence
The original CLI roadmap accepted
an independent Go executable and narrowed the first implementation to
doctor, check, init, single-site upgrade, dev, and build.
This proposal adds a maintenance program with a defined scope. Docsy migration, version
lifecycle, OpenAPI generation, and theme 1.2 retain their own scopes.
The 2026-10-03 local audit reran the Go suite and actual Hugo integration tests. A bilingual initialized site passed checks over 223 files and 4,461 references. The PIG consumer site passed over 1,392 files and 64,440 references, with 858 source files and its Git state unchanged.
The audit also reproduced four limits. A missing rendered link failed check
while build succeeded. Ordinary HTML references outside the configured base
path were marked untested. doctor --release accepted a Starter still using
https://example.org/. Both embedded deployment workflows called Hugo without
the CLI’s additional checks. Translation completeness and readable upgrade
diffs were absent. These findings define the first changes.
Product goal and users
Prioritize maintainers of multilingual engineering documentation and small teams maintaining several Hugo sites. Their recurring jobs are reviewing translations, preventing broken publications, updating dependencies, and reorganizing content without losing references or public URLs.
The product succeeds when an ordinary consumer repository can use one quality entry point locally and in CI. Maintainers must be able to inspect affected pages and apply reviewed changes while preserving unrelated work. CLI, Studio, and Agent callers must receive the same findings and change plans.
Feature selection
| Capability from the supplied design | Decision | Delivery |
|---|---|---|
| Links, anchors, attachments and machine outputs | Strengthen existing checks and explain uncovered cases | R1–R3 |
| Environment diagnosis, preview and strict builds | Complete release diagnosis and add opt-in verified builds | R1, R3 |
| Translation completeness and protected structure | Build as a primary product capability | R2 |
| Initialization and CI configuration | Extend the fixed Starter and manage reviewed CI changes | R3–R4 |
| Native content rules and project style | Implement a small deterministic core. Optional general tools | R2, R6 |
| New content, snippets and editor setup | Implement ordinary Hugo inputs with overwrite protection | R4 |
| Safe upgrades and migration preflight | Add diffs and candidate comparisons. Framework migration remains separate | R4 |
| Page moves, renaming and impact analysis | Implement after page relationships and change plans are dependable | R5 |
| Issue panels and translation comparison | Build a read-only local Studio first | R7 |
| Multiple sites | Add an explicit site registry over the same single-site engine | R6 |
| EPUB, PDF and offline packaging | Conditional adapter to distributed publication tools | E1 |
| Executable documentation examples | Conditional, explicit execution profiles | E2 |
| Agent inspection, impact and context | Implement deterministic local operations | R5 |
| AI translation and semantic review | Conditional proposals after deterministic maintenance works | E4 |
| Sources, evidence and knowledge dependencies | Limit this program to build/review provenance and observed page relationships | Wider knowledge management deferred |
| Rich editing, live collaboration and native desktop apps | Deliver safe Markdown editing only. Defer the broader platform | R8. Remainder deferred |
Scope and non-goals
R1–R8 define this PRD’s finite completion scope. Each stage can deliver value
and be accepted separately. Suggested CLI versions 0.2, 0.3, and 0.4
identify release candidates. They do not require public tags or theme versions.
The program does not include a renderer, universal migration engine, hosting account manager, deployment API, built-in LLM, vector database, remote editor, real-time collaboration, native desktop shell, or full WYSIWYG editor. Existing provider workflows perform deployment. Publication permissions and credentials remain consumer-owned.
Shared project facts and check policy
This scope is accepted locally. The original requirements below are retained as proposal history. Current behavior and flags belong to the CLI contract.
Extend the existing isolated Hugo analysis. Do not introduce a second configuration parser or navigation authority. Proposed internal facts include page identity, language, publication state, actual output URLs, known source files, translation relationships, and observed rendered references.
Use Hugo’s public Page.Translations and Page.OutputFormats for relationships and outputs. Page.File can provide provenance, but some pages have no backing file. Such findings must retain an output location and unknown source state. Any temporary probe must leave ordinary published outputs unchanged after its removal.
Use oink.yaml only for check selection, severity, translation policy,
reviewed exclusions, and tool/workflow options. Hugo continues to own languages,
titles, menus, URLs, and site configuration. Module files own theme versions.
Initially provide check links, check translations, and check style over
one shared analysis. Keep --json. --format json may be an additive alias.
Report blocking errors, warnings, and suggestions through the existing
error, warning, and info severities. Unsupported required tools or input
shapes remain exit 2. Policy cannot turn failed builds, unreadable inputs,
or incomplete required checks into success. Source locations need reliable
mapping. Otherwise report the actual output and pointer.
Translation maintenance
This scope is accepted locally. The original requirements below are retained as proposal history. Current behavior and flags belong to the CLI contract.
Support filename languages, language-specific content directories, and
translationKey relationships as resolved by Hugo. Coverage policies select
required languages for an explicit content scope. Disabled languages and
intentional localizations must not become missing-translation errors.
Check duplicate identities and configured draft/publication requirements.
If a production build omits a source needed to assess policy, use an explicit
analysis view. Do not confuse that view with publishable output.
Provide two policies: strict correspondence for manuals, and localized content for blogs or product pages. Strict policy can require explicit IDs, declared placeholders, selected code blocks, and necessary fields to agree. Localized policy checks only declared shared constraints. Heading counts and all code blocks must not become universal requirements.
Propose translations status, translations diff <page>, and an explicit
review-record operation. A versioned review record binds the translation to a
source content hash or Git revision, plus the translation hash and declared
source language. A missing record means unknown. A changed hash means changed
since review, not automatically a bad translation. Recording review requires
a user-requested write and must never happen just because a checker ran.
Native content rules and baselines
This scope is accepted locally. The original requirements below are retained as proposal history. Current behavior and flags belong to the CLI contract.
Start with a small catalog of high-confidence rules drawn from actual consumer failures: malformed supported component/attribute usage, conflicting explicit IDs, known deprecated forms, and configured protected content. Respect the syntax boundaries of code, inline code, shortcode bodies, raw HTML, and attributes. Do not apply regular expressions without regard to these boundaries.
Use the effective theme version’s contracts. An editor schema that omits types is not a complete strict validator. Missing compatible metadata must produce explicit limited coverage rather than validate against the latest theme. Do not require a future theme release to finish basic checks.
A visible versioned baseline can acknowledge existing findings with stable fingerprints, reasons, and review metadata. Reports show acknowledged and new findings separately. Baseline updates are explicit and reviewable. They cannot hide required incomplete work. Formatting and prose suggestions are optional. Automatic fixes first produce a diff, then validate a candidate before applying a narrow set of files.
Verified publication and CI
This scope is accepted locally. The original requirements below are retained as proposal history. Current behavior and flags belong to the CLI contract.
Preserve the current transparent build default. Add an explicit managed
build --check workflow. Run one strict Hugo build. Run selected checks on the
same output. Export only that verified artifact to a new or empty destination.
Do not delete arbitrary directories or mix stale files into a verified tree.
Default build must continue to report when extra checks did not run.
A local versioned manifest records the source revision and dirty state when known. It also records the source-input hash, effective theme identity, Hugo/CLI versions, build settings, base URL, check coverage, and file digests. Secrets and machine paths must not be copied into public metadata. If a public build marker is enabled, it contains only the minimum identity needed for verification. Artifact changes after validation invalidate the recorded result.
Propose ci init github-pages and ci init cloudflare-pages --mode direct-upload.
Generate local configuration only, explain variables and permissions, and
record template provenance. Detect existing workflows, preview diffs, preserve
unknown modifications, and require explicit application. Both use the same
quality engine and upload the verified output without another Hugo build.
Before a public CLI release, templates must accept a documented immutable
source/archival input rather than assume a nonexistent download tag.
Extend release diagnosis with an example-address warning, a release-policy error when publication checks require a real address, effective local source commit/dirty state when available, and comparisons with supported generated CI settings. Unknown custom CI is reported as unknown. A local checkout’s commit does not attest to a published module. Vendor byte identity remains separate.
Propose verify --site URL --manifest FILE with explicit network permission.
Check representative pages, languages, resources, search/Markdown outputs,
canonical addresses, and artifact identity. A generic fallback with HTTP 200
must fail identity checks. Timeout, authentication, rate limiting, or an absent
required identity produce unknown/incomplete results, not invented success.
Local HTTP fixtures test this without deploying to a provider.
Authoring and upgrade assistance
Add new, a small snippet catalog, and explicit editor-schema setup. Create
page bundles, selected translation drafts, and ordinary front matter while
refusing existing files. Translation drafts are not completed translations.
Editor hints follow the effective theme and preserve existing editor settings.
Extend init with docs, blog, book, and project profiles by composing one
licensed Starter source. Do not maintain four copied template trees. For existing
projects, provide diagnosis and reviewed proposals. Do not replace their configuration.
Keep the explicit-tag, single-site upgrade protections. Add readable unified diffs and baseline/candidate route and capability comparisons. Report removed URLs, changed aliases and missing previously enabled outputs. A clean candidate build alone does not prove compatibility. Proposed configuration migrations need a documented transform and tests. Otherwise return a manual action. Conflicting replacements and vendor refresh remain explicit owner operations.
Impact analysis and safe content changes
This supported scope is accepted locally. The original proposal requirements below remain as history. Current behavior, limits and flags belong to the captured-facts contract and move contract.
Provide inspect <page>, impact --since <ref>, and context <task> over the
shared facts. Inspect shows provenance, publication state, references,
translations, and outputs. Context packages relevant local material with
versions, paths, selection reasons, and size limits. No vector service or LLM
is required. Document content is data. It cannot authorize command execution.
Initially check --since may still perform a full check and say so. Later
optimization must include changed targets, their inbound references, translations,
and derived outputs. Deleting B must still inspect unchanged A that links to B.
Configuration, templates, navigation, or uncertain dependency changes expand
the scope to a full check. Cache data is disposable evidence. It is not an authority.
Propose move <source> <target> as preview by default. A plan contains touched
files, readable diffs, base hashes, translations, attachments, route changes,
and an alias recommendation. Rewrite only links whose meaning and ownership are known. Ambiguous template/shortcode references require review. Apply verifies bases,
validates an isolated candidate, protects concurrent edits, and retains recovery
information. A failed or stale plan must not partially overwrite user work.
Workspaces and optional tools
An explicit workspace registry names selected site directories. It reuses the single-site engine, reports per-site results and aggregate completion, and allows writes only to explicitly selected sites. It must not discover and upgrade every sibling repository automatically or duplicate Hugo settings.
Optional markdownlint, Vale, and lychee adapters use explicitly configured,
already provisioned tools and normalize their findings. Required missing tools
return 2. Optional omissions remain visible. If the adapter cannot understand syntax, exclude it. Do not rewrite it. Ambiguous external-link failures require a
network-status distinction. Tool installation and network access are separate
actions, and generic formatters never overwrite content by default.
R6 accepted local boundary
The explicit registry and optional adapters are accepted locally in supported R6 scope. Stable fields and limits are documented in the registry contract and tool contract. The accepted R7/R8 boundaries below retain their own evidence and limits.
oink.workspace/v1 names 1–64 literal directories in one regular YAML file
bounded to 256 KiB, without duplicating Hugo settings or discovering siblings.
Exact names, canonical root identity, registry-order selection, per-site
0/1/2 parity and explicit-name saved-plan application are the supported
workspace boundary. Already provisioned markdownlint-cli 0.49.1, Vale
3.24.0 and lychee 0.24.2 extend each site’s policy, with captured
configuration and typed protocol/source/network coverage. They do not install
or format tools/content. Lychee needs explicit network consent. Ambiguous
external failures remain unknown rather than definite broken links.
Frozen Go/vet, actual Hugo/pinned-tool, and owning race gates have passed. The exact binary also passed four-site direct/aggregate diagnostic/coverage/exit parity and all source byte, full-mode, Git, ignored-input, and directory guards. Initial preparation failures remain excluded, and the receipt-driver-only command metadata correction is recorded without a CLI runtime correction or rerun. Guarded canonical EN/ZH source/rendered checks passed, and supported R6/A07/A15 scope is accepted locally in the R6 record. Current A18 runtime/archive qualification passed. Darwin amd64 remains experimental/unverified.
Read-only Oink Studio
Build a local web interface with project overview, issue panel, translation comparison, page relationships, and publication panel. These views use the same core results as CLI/CI. Support filters, known-source navigation, actual Hugo preview, change comparisons, and copying proposed actions. A large graph or embedded editor is not needed for this acceptance.
Default to loopback and an explicit site allowlist. Separate untrusted rendered content from the management origin. Handle Host/Origin checks and session authorization before adding write APIs. Ship prebuilt UI assets with the CLI. Node is a contributor build dependency, not a consumer runtime requirement. Cover keyboard operation, screen-reader labels, mobile layouts, light/dark themes, and readable long diagnostic lists.
R7 candidate boundary
The read-only Studio candidate now serves an embedded five-view browser and an authenticated literal-loopback API over the same native checks and captured Hugo facts. Stable candidate boundaries are in the contract. Explicit existing-site/registry selection, typed paginated findings, source/diff/hash states, actual production preview and separate optional analysis coverage preserve the CLI authority.
Frozen native/browser/core-case and exact-binary four-consumer receipts now
qualify the supported read-only scope, including explicit partial-preview
incompletion. They exercise native 0/1/2 parity, keyboard/mobile/light/dark
flows, literal source data and separate-origin preview attacks. R7/A16
passed guarded canonical promotion/rendered gates and is accepted locally.
R1–R8 supported scope and current A18 runtime/archive qualification passed.
Safe Markdown editing
After the read-only interface is accepted, add Markdown editing, front matter forms, selected component insertion, and attachments. Reuse the CLI change-plan engine and actual Hugo preview. There is no second save/validation mechanism.
An unchanged open/save cycle must preserve bytes. Updating one field preserves unknown fields, comments, order, encoding, and unrelated whitespace. Detect external-editor changes and refuse stale saves. If a front matter form cannot preserve a construct, keep it editable as text and explain the form limitation. Do not round-trip the whole document through a generic serializer.
Writes need an authorized local session, an allowed directory, base verification, and a visible diff. Reject path traversal, symlink escapes, and requests from untrusted preview content. Attachments must not overwrite existing files. Publishing a static site never adds these management APIs to it.
R8 accepted editing boundary
R8 now has one source-preserving proposal engine for CLI edit text, field,
snippet and attachment, and the explicit studio --edit flow. Default Studio
remains read-only. Known site-owned Markdown, exact source hashes, supported
top-level YAML scalars with text fallback, original catalog byte-boundary
insertion and new-only leaf-bundle attachments share the same saved plans and
guarded writer. The complete visible review binds plan, file, and full-mode identities. Candidate HTML comes from actual selected nonpublishable Hugo analysis, with
native findings and required view incompletion kept distinct.
The accepted local interface is documented in the contract. Corrected frozen public/Go/race/vet, actual/ordinary Hugo, Editor browser accessibility/mobile and exact-binary four-consumer preservation gates passed. R8/A17 supported local scope also passed guarded canonical source/render gates and is accepted in the R8 record. R1–R8 supported scope and current A18 runtime/archive qualification passed. Darwin amd64 stays experimental/unverified.
Delivery sequence and schedule
The following estimate assumes one developer. T0 is the implementation start after scope approval. Dependencies are sequential acceptance gates, which additional staff can support through independent tests and UI work.
| Stage | Effective weeks | Delivery | Acceptance gate |
|---|---|---|---|
| R1 | 1–2 | Shared facts, check policy, focused scopes, trustworthy locations | Hugo owns routes/relationships. Required incomplete checks cannot pass |
| R2 | 3–5 | Translation policy/review state, native checks, visible baseline | Three language layouts. Strict/localized cases. Reviewed fixes preserve files |
| R3 | 6–8 | Verified build artifacts, CI init, release diagnosis, deployed-site verification | One checked artifact is uploaded. Stale bytes and HTTP 200 fallback are detected |
| R4 | 9–11 | New content, profiles, snippets/editor setup, upgrade diffs/comparisons | Ordinary Hugo build. Dirty/replaced/vendor and route-regression cases remain safe |
| R5 | 12–15 | Inspect, impact, context, move and shared change plans | Unchanged inbound links and translations are included. Stale plans cannot write |
| R6 | 16–17 | Explicit workspaces and optional check adapters | Per-site parity. Required unavailable tools are incomplete. No implicit installs |
| R7 | 18–20 | Read-only Studio and its security boundary | Five useful views. CLI/UI findings agree. Accessibility and preview isolation pass |
| R8 | 21–24 | Safe Markdown/forms/attachments with conflict review | No-op save has zero diff. Comments/unknown fields survive. Concurrent saves fail safely |
Allow another 4–6 weeks for integration, false-positive review, cross-platform execution, and repairs, distributed across the gates. The total planning range is 28–30 effective weeks (or roughly twice that elapsed calendar time at half-time availability).
R1–R3 yield a proposed 0.2 quality/publication candidate around weeks 9–10
including early reserve. R4–R6 yield a proposed 0.3 maintenance candidate
around weeks 19–20 cumulatively. R7–R8 yield a proposed 0.4 local Studio
candidate around weeks 28–30 cumulatively.
Conditional extensions
| Extension | Entry criterion | Proposed boundary | Separate estimate |
|---|---|---|---|
| E1 Publication exports | At least two maintained books need a recurring export workflow | Reuse distributable EPUB/PDF tools and package local artifacts. Declare external dependencies | 1–2 weeks after R3/R4 |
| E2 Executable examples | Explicit owners identify runnable examples and disposable test environments | Reviewed execution profiles, time/resource limits, offline default. Never execute discovered prose automatically | 3–5 weeks after R5 |
| E3 MCP | An existing Agent integration needs capabilities beyond invoking JSON CLI results | Thin adapter over inspect/check/impact/context/plans. Same permissions and diagnostics | 1–2 weeks after R5 |
| E4 AI review and translation | Deterministic translation maintenance works and a reviewed evaluation corpus exists | User-selected provider, explicit network/cost settings, proposals bound to source hashes. No automatic source writes | 3–6 weeks for a limited experiment after R5 |
The R1–R8 total excludes these estimates. Activate an extension only for its stated use case. A future need is not an unfinished core milestone. Remote Studio, live collaboration, native shells, general knowledge provenance, vector retrieval, and universal framework migration require separate PRDs and evidence.
Architecture and compatibility
Use Go for core operations. Use subprocesses for Hugo and optional tools. Extend existing packages when they own the behavior. Add a package only with its capability. Do not create a generic plugin platform, public SDK, or shared service layer before an actual consumer needs it.
Preserve oink.result/v1, exit meanings, and the default thin wrappers. New
diagnostic details and command data may be additive. Changed field semantics
need a new result version. Version review records, baselines, plans, build
manifests, and workspace registries independently. Detect supported capabilities
from the actual theme. Do not require all users to install the latest release.
Read/check/preview, local file application, networking, example execution, and deployment have separate side effects. No telemetry, background updater, credential discovery, arbitrary directory cleanup, global configuration change, commit, push, or deployment happens as a maintenance side effect. Read-only consumer trials preserve sources, replacements, workspaces, and vendor bytes.
Acceptance cases and owning checks
| Case | Required outcome | Primary owner |
|---|---|---|
| A01 JSON and completion | One JSON result on stdout. Clean stderr separation. Findings 1, required incompletion 2 |
internal/report, internal/app, Schema |
| A02 Hugo truth | Slug/url/permalinks/aliases, custom mounts, unlisted pages and language roots follow actual Hugo results | internal/site, internal/outputcheck, actual Hugo fixtures |
| A03 Subpaths | A definite project-local missing route fails. Outside-origin/path references remain classified honestly. Declared external scopes avoid false positives | Output checker and policy tests |
| A04 Translations | Filename, directory and translationKey layouts. Duplicate/missing/draft cases. Strict/localized policy | Translation engine and public-command tests |
| A05 Review state | No record is unknown. Changed source hash is visible. Mtime never determines review state | Translation/review-record tests |
| A06 Content syntax | Fences, inline code, shortcodes, HTML, attributes, custom fields and configured protected text do not generate invented findings | Native-rule tests and real content corpus |
| A07 Baselines and adapters | Acknowledged findings remain visible. New findings fail policy. Unavailable required tools cannot pass | Policy/adapter tests |
| A08 Artifact identity | Modify a file after check and manifest verification fails. Provider upload uses the same exported tree without rebuilding | Managed-build and workflow tests |
| A09 CI preservation | Both templates, existing customized workflows, permissions/variables, preview/apply conflict and provenance | Starter/CI tests and local workflow rehearsal |
| A10 Public verification | HTTP 200 fallback, wrong language/build, missing resource, canonical mismatch, timeout/auth/rate limit | Local HTTP fixtures, no required cloud account |
| A11 Initialization and authoring | Supported profiles/languages. Empty-target protection. Generated sites build with ordinary Hugo. Editor config preserves unknown settings | internal/starter, authoring and Hugo tests |
| A12 Upgrade | Readable diff, old/new routes, dirty files, both workspaces, replacement/vendor, failure recovery and concurrent edits | internal/upgrade, public-command/Hugo tests |
| A13 Impact | Deleted B finds unchanged A. Translations/attachments/derived outputs included. Global changes expand scope | Impact and Git-baseline fixtures |
| A14 Change application | Candidate validation before apply. Hash conflicts and failed writes preserve subsequent edits. Ambiguous references are not rewritten | Shared plan/apply and move tests |
| A15 Workspace and context | Per-site results match direct invocation. Selected writes only. Bounded context gives paths/versions/reasons without executing content | Workspace/context tests |
| A16 Studio parity | Five views show the same results as CLI. Usable keyboard/mobile/light/dark flows and source/preview separation | Studio browser/accessibility tests |
| A17 Editor preservation | No-op save is byte-identical. YAML comments/unknown values/order survive. Stale saves and attachment collisions are rejected | Editor/browser and shared apply tests |
| A18 Runtime and recovery | Test actual declared macOS/Linux targets. Signals stop child processes. Cached operations work offline. Unsupported inputs remain explicit | Process/integration/installation tests |
Run the smallest owning tests before broader integration. Keep Go unit fixtures offline. Repeat actual Hugo tests after parser, snapshot, probe, initialization, or upgrade changes. Keep focused checks. Do not require consumers to run theme internals or a browser suite for every document change.
For each candidate, record tool versions and source identities. Then test the Starter and three distinct maintained sites without writes. Compare source bytes, modes, and Git state before and after. Tests for new native rules need a reviewed valid/invalid corpus. Fix false positives before enabling a blocking default. Before promising incremental speed, measure full-build time against the same current-site baseline. Functional correctness takes priority over check counts.
Completion and release evidence
For each stage, record implemented behavior, known limits, focused tests, and actual integration results. Provide updated EN/ZH contracts/guides and a reviewable diff. Track individual requirement/case statuses. This PRD is complete only when R1–R8 and their required acceptance cases are satisfied.
After supported behavior is accepted, move it into the owning CLI contract, usage guides, and durable decisions. Retire the corresponding proposal sections through the existing lifecycle.
Decisions and stop conditions
Confirm staffing and start date before turning relative weeks into calendar dates. Decide supported runtime targets, review-record storage details, initial native-rule catalog, and precise additive command flags in R1. These are bounded implementation choices within this scope, not reasons to reopen the product boundary or wait for an entire theme release.
If preservation or correctness work exceeds a stage estimate, move its optional convenience work later. Never remove stale-write protection, truthful completion, or ordinary-Hugo compatibility. If repeated corpus review shows that a rule is unreliable, keep it advisory or remove it. If a form cannot preserve source bytes, keep that syntax in text mode. Interest in implementing a conditional extension does not add it to the critical path.
Decision log
| Date | Record |
|---|---|
| 2026-10-03 | Created from the current CLI audit and the supplied feature goals. Proposed R1–R8, optional extension gates, resource assumptions and executable acceptance cases. |
| 2026-10-03 | R1 shared Hugo facts and check policy passed local owning/actual-Hugo checks. Stable behavior moved into the CLI contract. The acceptance record tracks final refreshed reports and rendered EN/ZH evidence separately. R2–R8 and conditional extensions remain open. |
| 2026-10-03 | R2 translation scopes/hash reviews, syntax-bounded native rules and visible baselines now use shared guarded file plans. Local owning, actual-Hugo and focused race gates passed. Final refreshed consumer and EN/ZH documentation acceptance remains pending in the record. Implemented behavior is in the contract. R3–R8 remain open. |
| 2026-10-03 | R2 final corpus and bilingual documentation gates passed. R3 one-render checked export, exact file identity, guarded CI plans for both providers, release diagnosis and explicit-network HTTP verification passed their scoped local gates, including custom-workflow discovery. Stable behavior moved to the contract. Exact evidence and A08–A10 outcomes belong to the maintenance record. R4–R8, final A18 runtime/archive refresh and Darwin amd64 remain open. |
| 2026-10-03 | R4 supported local scope passed frozen Go/vet, actual Hugo/race and exact-binary read-only Starter/docs/PIG/repository gates. One unchanged licensed Starter composes all profiles/languages. Ordinary new/editor/snippet flows and source/external-input guards passed, as did readable bounded upgrade views and alias/output regression protection. Stable behavior belongs to the contract. Exact A11/A12 evidence and remaining limits belong to the record. R5–R8, final A18 runtime/archive refresh and Darwin amd64 stay open. |
| 2026-10-03 | R5 corrected frozen Go/vet, actual Hugo/race and exact-binary four-consumer read-only gates completed. Inspect/context complete for all sites. Historical impact and move blockers remain explicit. Guarded canonical source/rendered gates and stage acceptance are pending. Stable behavior belongs to the contract. The record identifies A13/A14/context evidence, the cached-module correction and exact preservation receipt. R6–R8, workspace A15 and final A18 remain open. |
| 2026-10-03 | R5 supported inspection/impact/bounded-context and guarded move scope is accepted locally after corrected frozen owning gates, exact-binary four-consumer preservation and first-promotion canonical source/rendered gates. The production translation owner retains only its known draft-release omission. Separate nonpublishable analysis passes all owners. Stable behavior belongs to the contract and command reference. The record retains exact outcomes and the separate post-render evidence boundary. A13/A14 supported CLI scope passed. A15 context passed while workspace/direct parity remains R6. R6–R8 and final A18 remain open. |
| 2026-10-03 | R6 explicit registry and bounded optional-tool candidate implemented. Focused workspace and corrected actual-protocol trials passed, with preparation failures kept separate. Final runtime/corpus/canonical gates and A07/A15 stage acceptance remain pending in the R6 record. R7/R8 and final A18 remain open. |
| 2026-10-03 | R6 frozen Go/vet, actual Hugo/pinned tools, owning race and exact-binary four-consumer direct/aggregate parity/preservation qualified. The completed receipt records six original operations, existing repository duplicate-ID findings and a driver-only command-summary correction over unchanged raw outputs. No CLI/Hugo rerun or runtime fix was needed. Canonical source/render checks and explicit R6/A07/A15 stage acceptance remain pending in the record. R7/R8/final A18 remain open. |
| 2026-10-03 | R6 supported explicit-registry and optional-tool scope is accepted locally after frozen Go/vet, actual Hugo/pinned tools, race, exact-binary four-consumer parity/preservation and guarded canonical source/render gates. A07 adapters and A15 workspace/direct/context supported scope passed. The R6 record separates first-promotion rendered bytes from this post-render status/evidence amendment. R7/R8 and final A18 remain open. |
| 2026-10-03 | R7 read-only embedded Studio candidate and authenticated loopback views implemented. Frozen core/browser and exact-binary four-consumer qualification completed within the declared scope. Guarded canonical promotion/render and explicit R7/A16 acceptance remain pending. R1–R6 remain accepted. R8/final A18 open. |
| 2026-10-03 | R7/A16 supported read-only Studio is accepted locally after frozen cumulative executed-case/browser proof, exact-binary four-consumer parity/preservation and guarded canonical source/render gates. First-promotion rendered bytes remain distinct from this post-render status amendment. Whole invocation failure and explicit partial-preview incompletion stay visible. R1–R7 accepted. R8/final A18 open. |
| 2026-10-03 | R8 CLI/opt-in Editor source-editing candidate implemented. Default Studio remains read-only. Pure-core/streaming-output focused evidence is recorded and failed browser trials retained. Final frozen public/browser/consumer/canonical gates and A17 stage acceptance remain pending in the R8 record. R1–R7 remain accepted. R8/final A18 open. |
| 2026-10-03 | R8/A17 reviewed CLI/opt-in Editor supported local scope is accepted after corrected frozen whole owning/browser gates, exact-binary four-consumer proposal parity/source preservation and guarded first canonical promotion/actual rendering. R1–R8 are accepted locally. The R8 record separately binds first-rendered and current status bytes, retaining every failed trial, native finding and required partial-preview incompletion. Final A18 current Linux/archive qualification remains open. |
| 2026-10-04 | Current backend integrity correction, refreshed owning/Hugo/race, carried unchanged-runtime four-consumer preservation and three declared runtime/archive qualifications passed. See the dated completion supplement. Finite R1–R8 implementation is complete locally. Retain this requirements record and anchors, retire it from active navigation, and keep stable behavior in the contract/guide. E1–E4 have not been invoked. |
15 - Visual presets and appearance switching
Paper, Slate and the Appearance menu ship with OINK 1.2.0; OINK 1.7.0 further refined all four presets, added per-preset CJK system typography, and finalized the t/y shortcuts. The architecture contract,
accepted decision and
acceptance record
own current behavior and evidence. A subsequent Ink/Terminal experiment
provides actual selectable output; this proposal remains active for their design acceptance. The October 4 injected screenshots are research prototypes; they
are distinct from the October 5 screenshots of actual theme output.
Status and surface
| Field | Value |
|---|---|
| Status | Phase 1 released in 1.2.0; Ink/Terminal explicit opt-ins |
| Owner | OINK maintainers |
| Date | 2026-10-04 |
| Baseline | OINK v1.4.0 theme and documentation site; this row preserves the proposal’s October 4 research starting point |
| Affected contracts | Architecture: Trust, CSS, and accessibility (font roles, accent roles, inline-code colour), Shell (theme control), Landing, Configuration decision, Brand guide |
| Phase 1 | Paper preset, Slate preset, default changed to Paper, reader switching between Paper and Slate |
| Later phases | Ink/Terminal design acceptance; Folio and Canvas names reserved only |
Context and evidence
The baseline and limitations below record the October 4 research input, before phase 1.
OINK ships one visual identity, referred to here as Slate: a cool blue-grey
canvas (#f1f4f8 / #0b1119), navy text, steel-blue links (#245f94), copper
accents, Inter for interface and prose, Chakra Petch for display and wordmark,
IBM Plex Mono for code and technical labels, a blueprint grid and glow on the
Landing hero, and a crimson inline-code pair. It is defined by Bootstrap
custom properties in assets/css/td/brand.css, shell tokens in
assets/css/td/shell/tokens.css, and font roles in
assets/css/td/tokens-typography.css. In releases up to 1.5.1 these are the
SCSS partials _brand.scss, shell/_tokens.scss and _tokens-typography.scss
under assets/scss/td/.
PG.CENTER, an independent site, has a warm editorial reading style that
maintainers want as the future OINK default. Its presentation tokens live in
media/css/pgsql.css of that project. Measured on its local preview
(2026-10-04, light and dark, home, Docs index, long manual page, component
manual):
| Role | Light | Dark | Note |
|---|---|---|---|
| Canvas | #f7f6f3 |
#161513 |
warm white / warm black |
| Raised surface | #ffffff |
#1d1c19 |
cards, code blocks |
| Secondary surface | #efede8 |
#262420 |
table header, hover |
| Ink | #21201c |
#ece9e3 |
body text |
| Secondary text | #56534c |
#b6b1a7 |
|
| Lines and washes | ink at 4.5–22 % alpha | light ink at similar alpha | no tinted greys |
| Radius | 12 px / 8 px | same | |
| Shadow | 0 2px 10px rgba(33,32,28,.07) |
black-based | warm, soft |
| Motion | 160 ms cubic-bezier(.2,.7,.2,1) |
same |
Typography is IBM Plex Sans (variable, 400–600) for interface and prose, IBM Plex Mono for code, dates and versions, and Chakra Petch for the wordmark only. The component-manual pages are the best long-form model: lead paragraph 17 px capped at 70ch, h2 followed by a hairline that runs to the edge, framed tables with a header band and no zebra, monochrome callouts with a 3 px rule.
The following PG.CENTER elements are site identity, not reusable reading
rules: the PostgreSQL brand blue #336791 family, wine content links,
version-state colours, release strips, search-kind badges, wiki tones, the
duotone hero, and the 144-character measure of the imported PostgreSQL manual.
Two values fail WCAG AA (muted text 3.67:1, link hover 4.22:1) and are
corrected below rather than copied.
Measured OINK docs typography for comparison: 16 px / 1.7 body, ≈ 76ch measure, h1 36 px / 700, h2 24 px / 600, code 14 px. PG.CENTER Docs index: 15.5 px / 1.7, ≈ 120ch.
Current limitations
- Colours are tied to
data-bs-themeonly. No attribute selects a second palette, and several surfaces bypass tokens: the Landing primary button (#2f6793with navy glows), the grid, scrims (rgba(4,10,18,.45)), print colours, asciinema surfaces, and the giscus stylesheets. - About 85 literal border radii and several literal shadows make a flat preset impossible without a radius and shadow scale.
- The light/dark control expands on hover or focus. Touch readers cannot reach
“follow system”; the trigger mixes
aria-pressedandaria-expanded; Esc does not close it. The Landing mobile drawer has no theme control. contrast-on-canvas.htmlhard-codes Slate canvas luminance for thetheme_colorwarning.dark_modeis opt-in (falseby default), so the palette and its menu are absent unless a site enables them.
Goals and non-goals
Goals:
- one site key selects the default visual preset; Paper becomes the default;
- Slate remains available and reproduces current output for sites that choose it;
- readers can switch Paper and Slate instantly, without reload, independent of light/dark/system mode;
- the configured default renders without JavaScript and with storage unavailable;
- presets share templates, components, and layout geometry; they change paint and type;
- local fonts only, ordinary Hugo build, no new runtime framework or required build tool.
Non-goals:
- implementing Ink, Terminal, Folio, or Canvas in phase 1;
- copying PG.CENTER brand colours, version UI, or page structures;
- per-page or per-section presets (section colour remains
theme_color); - changing layout geometry, density, or navigation structure per preset in phase 1;
- theming Swagger UI, ReDoc, or third-party embeds beyond their existing light/dark handling.
Preset model
This table and the phase-one configuration below retain the original scope.
The later experiment adds explicit ink/terminal configuration and menu-list
entries; true still offers the stable set plus the site default. The
architecture contract owns current behavior.
| Preset | Direction | Phase 1 | Reader menu |
|---|---|---|---|
paper |
Warm editorial minimalism | Implemented, default | Yes |
slate |
Technical minimalism (current OINK) | Implemented | Yes |
ink |
Typographic minimalism, Swiss-inspired | Spec + research prototype | No |
terminal |
Terminal-inspired utilitarian | Spec + research prototype | No |
folio |
Academic / book publishing | Name reserved | No |
canvas |
Playful geometric / creator | Name reserved | No |
Reserved names are rejected by validation until implemented, with a warning that names the stable presets.
Configuration
presetselects the site default. Invalid or reserved values warn through the existing validation path and fall back topaper. Publishing gates turn the warning into a failure.preset_menucontrols the reader choice.falserenders no style group and emits no preset-init script;trueoffers every stable preset; a list offers a subset that must containpreset. Following thedark_modeprecedent, the default isfalse; the documentation site enables it; starter adoption is outside this change.presetis site-level only. Page and section overrides are not supported: switching identity per page would break reader expectation and the stored choice.- The Appearance menu exists when either
dark_mode.show_menuor a style choice is enabled. A site withdark_mode: falseandpreset_menu: trueshows only the Style group.
Relationship to existing keys
Precedence, lowest to highest:
- Slate base tokens on
:root/[data-bs-theme](unchanged selectors). - Preset tokens on
[data-td-preset=X]. params.ui.typography: system— collapses font roles to system faces after the preset blocks, so it still requests no brand font in any preset.params.ui.fonts— emitted inline after the stylesheet at:root; equal specificity and later source order beat preset font roles. Explicit fonts always win.theme_color/theme_color_dark— page and section accent backgrounds only. They override the preset accent; they never touch links or inline code.- The site’s project stylesheet,
assets/css/project.css— loaded after the theme’s stylesheet. In releases up to 1.5.1 it is_styles_project.scss, last in the compiled bundle.
typography: technical remains the name for “use the preset’s bundled faces”.
The preset decides which bundled faces those are (Paper: Plex Sans; Slate:
Inter + Chakra Petch).
Reader state
Two independent dimensions:
| Dimension | Attribute | Storage | Values |
|---|---|---|---|
| Style | data-td-preset on <html> |
localStorage['td-preset'] |
stable preset names |
| Mode | data-bs-theme (+ .dark-mode, vendor data-theme mirror) |
localStorage['td-color-theme'] |
light, dark, auto |
| Situation | Result |
|---|---|
| First visit | Server renders data-td-preset="<site preset>" and data-td-site-preset; no script needed |
| Reader chooses a preset | Applied at once, stored, td-preset-change dispatched |
| Reader chooses the preset marked “Default” | Storage key removed; future site default changes reach this reader |
| Next page, refresh, other language | Inline head script applies the stored value before first paint |
| Stored value no longer offered | Removed; site default used |
| Storage unavailable | Choice applies to the current page; the menu states that it will not persist |
| JavaScript disabled | Site default preset renders in its light palette, as the current theme does without script; no style or mode control is usable |
| Style change | Never writes td-color-theme; mode change never writes td-preset |
| Other tab changes the value | storage event applies it |
The inline script runs before the stylesheet, beside the existing dark-mode
script. It validates the stored value against the allowed list embedded at
build time, sets the attribute, and updates the theme-color meta and the
pre-paint canvas colour for the preset and mode. It is emitted only when the
menu offers more than one preset. Independently of the menu, the static
pre-paint <style> and the resolved theme-color meta in head.html are rendered
from the site default preset’s canvases instead of the current hard-coded
#0b0d12, #ffffff, and #000000.
On switch the runtime sets data-td-preset-switching for one frame to suppress
colour transitions, records the first visible heading or block as a scroll
anchor, applies the attribute, and restores the anchor offset, again after
document.fonts.ready because Plex Sans and Inter have different metrics.
Focus, open menus, and form state stay untouched. Phase 1 uses no cross-fade
or View Transition.
Appearance menu
Three options were compared:
| Option | Assessment |
|---|---|
| Keep the hover menu, add a style row | Keeps the touch and keyboard gaps; hover-only discovery |
| Separate style and mode buttons | Two icons in a crowded navbar; mobile drawer gets longer |
| One Appearance disclosure with two radio groups | Chosen: one entry point, works with touch and keyboard, scales to more presets |
Behaviour:
- Trigger: one icon button (
aria-expanded,aria-controls, label “Appearance”). It replaces the current theme button in the navbar and in the shell footer line. Sun means the current light state; moon means dark. Thetshortcut keeps toggling light/dark. - Panel: a non-modal popover containing two native
fieldsetradio groups. The October 5 revision uses Style: icon-and-name buttons in two columns, with a preset-colored icon and no preview letters or experiment badges. The site default is identified by its tooltip and accessible name. Light: a segmented Light / Dark / System control. Selection applies immediately and the panel stays open so readers can compare. - Keyboard: Enter/Space or ArrowDown opens and focuses the checked radio; arrow keys move within a group (native radio behaviour); Tab moves between groups; Esc closes and returns focus to the trigger; focus leaving the panel or an outside click closes it.
- Feedback: the selected option has a tinted background and accent border; keyboard focus has a separate outline. Changes are announced through native radio semantics; no extra live region.
- Restore default: selecting the site’s default preset clears the stored choice. No separate reset button is needed.
- Mobile (< 768 px): the trigger stays in the compact header and is also
offered in the docs drawer footer and in a new row of the Landing mobile
drawer. The panel opens as a bottom sheet with 44 px targets, the same two
groups, and a close button. The sheet is a modal
<dialog>opened withshowModal(), so it lives in the top layer: the prototype showed that the sticky header’sbackdrop-filterotherwise becomes the containing block of aposition: fixedsheet and the drawer’s stacking context hides it. - Command palette: a
switch_presetaction next toswitch_theme.
dark-mode.js keeps its storage key and attributes. It must sync the
checked state of the Light radios and listen to their change events instead
of the current aria-pressed buttons.
Token architecture
All presets are part of the single existing main.css. Fonts are declared
with @font-face and are downloaded only when a rule uses them, so offering a
preset costs CSS bytes but no font bytes until it is selected.
Rules:
- Token parity. Each dark block redeclares every token of its light block, so Slate dark never leaks into another preset. A checker enforces it.
- Dark islands. The descendant form covers nested
data-bs-theme="dark"islands (Landing code plate, previews). - Font roles only at (0,1,0), so
params.ui.fontskeeps winning. - Accent indirection. Presets set
--td-preset-accent(and-rgb,-hover);--td-accentdefaults to it.theme_colorkeeps writing--td-accentand therefore overrides the preset in both modes. - Slate stays attribute-free.
data-td-preset="slate"matches no override block, so current site overrides of brand tokens behave exactly as today. - Geometry is shared. Presets do not change grid columns, sidebar width, or breakpoints in phase 1.
- Preset-specific rules are few and scoped to
[data-td-preset=X]in one partial per preset. Anything two presets need becomes a token.
New shared tokens required before Paper (phase 1): --td-shell-scrim, Landing
--td-grid / --td-glow / primary-button tokens, --td-callout-tint,
--td-code-inline-bg, --td-hairline, and a brand font role
(--td-brand-font-family, default var(--td-display-font-family)) so the
wordmark can keep Chakra Petch while Paper’s display headings use Plex Sans.
The original phase-two plan proposed global radius, shadow and density scales. The October 5 experiment instead scopes those changes to owned components; a wider token refactor is not a prerequisite for trying the designs.
Contract change: the architecture contract currently fixes inline code to a
crimson pair. This proposal makes --bs-code-color a preset token (Slate
keeps crimson, Paper uses an ink chip). theme_color still never touches it.
Fonts
| Preset | UI / body / heading | Display | Brand (wordmark) | Meta | Code | New bytes |
|---|---|---|---|---|---|---|
| Paper | IBM Plex Sans | IBM Plex Sans | Chakra Petch | IBM Plex Sans | IBM Plex Mono | Plex Sans |
| Slate | Inter | Chakra Petch | Chakra Petch | IBM Plex Mono | IBM Plex Mono | none |
| Ink | Inter | Inter | Inter | Inter (tabular) | IBM Plex Mono | none |
| Terminal | Plex Mono chrome, Plex Sans prose | IBM Plex Mono | IBM Plex Mono | IBM Plex Mono | IBM Plex Mono | none after Paper |
Paper vendors @fontsource-variable/ibm-plex-sans (OFL-1.1) into
third_party/ with a VENDOR.json entry: Latin, Latin Extended, Cyrillic, Cyrillic Extended, Greek and Vietnamese
subsets, normal and italic, weights 100–700. PG.CENTER’s normal-only 400–600 subset is
40,240 B (latin) + 25,868 B (latin-ext); exact sizes are recorded at vendor
time. Italic is required because OINK prose uses emphasis and PG.CENTER’s
synthesized italic is not acceptable. The full small subsets preserve the existing locale coverage; the browser
loads only the ranges actually used. All 12 font files are recorded in VENDOR.json.
Chinese, Japanese and Korean use system stacks placed after the Latin face:
-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', sans-serif. IBM Plex Sans SC was rejected
because its files are megabyte-scale. Monospace stacks insert CJK sans
families before the generic monospace keyword so mixed code keeps a
predictable CJK face.
typography: system continues to request no brand font: the system block
follows every preset block and resets all roles, including brand.
Serif. Phase 1 uses no serif. Latin serif headings beside CJK sans headings look inconsistent, Windows’ default CJK serif renders poorly at heading sizes, and a serif costs another font. A later opt-in display-only serif can be reviewed with the side-by-side mockup produced for this proposal.
Preset specifications
Shared foundation
Belongs to every preset, not to Slate:
- layout geometry, breakpoints, sidebar/TOC widths, ≈ 76ch prose measure;
- body 1rem / 1.7 for prose, 0.875rem for chrome, 0.8125rem for meta;
- type scale ratios (h1 2.25rem, h2 1.5rem, h3 1.25rem, h4 1rem) — presets tune weight and tracking, not size, in phase 1;
- focus ring: 2 px accent outline with 2 px offset, never removed; forced-colors fallbacks unchanged;
- semantic status colours (note, tip, important, warning, caution) keep their hue; presets change tint strength and frame;
- syntax highlighting keeps the existing light/dark Chroma palettes in phase 1;
- motion tokens 100/150/250 ms;
prefers-reduced-motiondisables transitions; - WCAG AA: 4.5:1 body, 3:1 large text and UI boundaries, in both modes.
Paper
Warm editorial minimalism. Warm paper, ink text, quiet hairlines, soft shadows, and generous but not loose reading rhythm. It serves long-form reading: lower blue light on large canvases, less chrome contrast, and a typeface (Plex Sans) with open counters that reads well at 16 px.
| Token | Light | Dark |
|---|---|---|
Canvas --bs-body-bg |
#f7f6f3 |
#161513 |
Raised --td-brand-elev, --td-pre-bg |
#ffffff |
#1f1e1a / #121110 |
| Secondary surface | #efede8 |
#1f1e1a |
| Body | #21201c (15.09:1) |
#ece9e3 |
| Secondary text | #56534c (7.10:1) |
#b6b1a7 |
| Tertiary text | #6b665d (5.27:1) |
#958f84 (5.68:1) |
| Border | ink 12 % | light ink 13 % |
| Link / hover | #2b5f8c (6.23:1) / #1d68a5 (5.43:1) |
#7db5e6 (8.36:1) / #a3cdf3 |
| Accent (copper) | #9c5530 (5.17:1) |
#d99a6c |
| Inline code | ink on ink-6 % chip | light ink on 8 % chip |
| Shadow sm / md | 0 2px 10px / 0 14px 38px ink 7 % / 13 % |
black 35 % / 50 % |
| Radius | code 12 px, cards 12 px, controls 8 px | same |
Rules specific to Paper: headings Plex Sans 600 with −0.006em (h1 −0.012em); h2 followed by an edge hairline; framed tables (radius 10, header band, no zebra); callouts with a 4 % (dark 6 %) semantic wash and a single 3 px rule; hairline blockquote; Landing without grid or glow, primary button from tokens with a warm shadow, hero title 600 / −0.025em; selected navigation rows on a warm neutral ground with 9 % (dark 12 %) accent mixed in. Links remain blue: a reading convention, not decoration. Motion 160 ms ease-out for hover and popovers; no movement on scroll.
Slate
Technical minimalism. The current OINK appearance, unchanged: cool blue-grey
canvas, navy ink, steel blue and copper, Inter body, Chakra Petch display,
Plex Mono labels and metadata, blueprint grid and hero glow, crimson inline
code, 8–12 px radii. Selecting preset: slate must reproduce v1.1 token
values; a checker compares them. Grid, glow, Chakra display headings, mono
metadata and crimson inline code are Slate identity. Layout, focus, status
colours, and the shell structure are shared foundation.
Ink
Typographic minimalism, Swiss-inspired information design. Black, white and neutral grey; one red accent; hierarchy carried by size, weight and alignment rather than colour, shadow or rounded surfaces.
| Token | Light | Dark |
|---|---|---|
| Canvas | #ffffff |
#0b0b0b |
| Body | #141414 |
#ededed |
| Secondary / tertiary | #474747 / #636363 |
#b5b5b5 / #8f8f8f |
| Surface | #f4f4f4 |
#161616 |
| Link | ink, underlined; hover red | light ink, underlined; hover red |
| Accent | #c8102e (5.88:1) |
#ff5c4d |
| Radius / shadow | 0 / none | 0 / none |
Differences from Slate: no tinted canvas, no blue, no grid texture, no shadows, no rounded corners; links are identified by underline, not hue; headings use Inter 700–800 with tight tracking instead of Chakra Petch. Differences from Paper: neutral not warm, flat not soft, ruled not hairline, underline links not blue. Distinctive rules: 2 px black rule above h2; h1 800 / −0.035em; uppercase tracked h4, table headers and callout titles; selected navigation row marked by a 3 px red bar, not a fill; tabular numerals.
Terminal
Terminal-inspired utilitarian design. Structure and information expression, not CRT effects: monospaced chrome, command and path notation, compact controls, strong panel borders, amber or teal accents.
| Token | Light | Dark |
|---|---|---|
| Canvas | #f4f5f2 |
#0c0f0e |
| Body | #1d211f |
#d3dbd6 |
| Secondary | #4a514d |
#9aa59f |
| Surface | #e9ebe6 |
#141a18 |
| Link (teal) | #0a6560 (6.31:1) |
#4cc9bd |
| Accent (amber) | #935400 (5.47:1) |
#f0a73a |
| Radius | 2 px | 2 px |
Mono scope: navigation, headings, labels, metadata, breadcrumbs, buttons and
code use IBM Plex Mono. Prose paragraphs, lists and table bodies use Plex Sans
with platform CJK fallbacks, because long monospaced paragraphs and mixed CJK/Latin mono lines
read poorly. Distinctive rules: ## prefix before headings rendered with
content: '## ' / '' so assistive technology ignores it; bracketed callout
labels ([NOTE]); the selected navigation row is inverted with a ▸ marker;
1 px strong panel borders; static ▍ caret in the hero. No scanlines, glow,
blinking, or typing animation.
Difference matrix
| Paper | Slate | Ink | Terminal | |
|---|---|---|---|---|
| Temperature | warm | cool | neutral | neutral-green |
| Canvas light | #f7f6f3 |
#f1f4f8 |
#ffffff |
#f4f5f2 |
| Canvas dark | #161513 |
#0b1119 |
#0b0b0b |
#0c0f0e |
| Prose face | Plex Sans | Inter | Inter | Plex Sans |
| Heading face | Plex Sans 600 | Inter 600–700 | Inter 700–800 | Plex Mono |
| Display / wordmark | Plex Sans / Chakra | Chakra / Chakra | Inter / Inter | Plex Mono |
| Link signal | blue | steel blue | underline + red hover | teal |
| Accent | copper | copper | red | amber |
| Radius | 8–12 | 8–12 | 0 | 2 |
| Shadow | soft warm | navy-tinted | none | none |
| Section rule | h2 trailing hairline | none | 2 px top rule | ## marker |
| Selected row | warm tint | accent tint | red bar | inverted + ▸ |
| Inline code | ink chip | crimson | ink chip | ink chip, bordered |
| Landing texture | none | grid + glow | none | none |
| Chrome density | standard | standard | standard | compact |
Page density
Density follows the task, not the preset: the Landing hero allows the largest display type and brand expression; Docs prose keeps 1rem / 1.7 and ≈ 76ch; sidebar, TOC, parameter tables, search results and the command palette keep compact rows (0.875rem, 1.4–1.5 line height). Presets may change paint inside these zones but not their spacing in phase 1. Terminal’s compact chrome is a phase 2 density token.
Runtime surfaces
| Surface | Phase 1 impact |
|---|---|
| Blog, Book, taxonomy | Tokens only; Book captions keep the prose face |
| Search dialog and command palette | Scrim tokenized; selected row uses --td-shell-primary-dim |
| Mermaid, ECharts | Colours baked at init on data-bs-theme. Add a data-td-preset observer only if charts take preset colours; phase 1 keeps mode-only chart palettes |
| asciinema | Surface tokens; re-mount only if the code face changes (not in phase 1) |
| giscus | Needs one stylesheet per preset and mode, re-posted on td-preset-change |
| Swagger UI, ReDoc | Keep vendor styling and current light/dark handling |
| Tokenize navy and cool greys; print always uses a light palette from the active preset | |
| 404 | Its own <html> must carry the new attributes |
Accessibility, security, and output
- Every preset palette passes WCAG AA for body, secondary and tertiary text,
links, and accents in both modes (values above).
theme_colorcontrast warnings compute against the active site default preset’s canvases. - The menu uses native radios; no
role="menu". Focus is never trapped except in the mobile bottom sheet, which is modal and restores focus. prefers-reduced-motionand forced colors keep current behaviour.- The init script is inline, static, and derived from validated configuration; the stored value is matched against a build-time allowlist before use.
- No external font or script request is added. Output adds two
<html>attributes, one inline script, and CSS.
Compatibility and migration
Changing the default to Paper changes every site that does not set preset.
- Sites that want the current look add
params.ui.preset: slate; the upgrade note leads with this one line. Slate output must equalv1.1tokens. - Sites with custom brand overrides in their own styles (
_styles_project.scssup to 1.5.1,assets/css/project.cssafter it): light overrides on:rootkeep working under Paper by source order; dark overrides on[data-bs-theme='dark']are outranked by Paper’s dark block. Such sites should choose Slate or move overrides to[data-td-preset='paper'][data-bs-theme='dark']. The upgrade note and brand guide document this. theme_color,typography, andfontskeep their meaning and precedence.- Sites with
dark_mode: falsestill get one light palette, now Paper. - The release that changes the default must state it as a visible change.
Whether that release is a minor (
1.x) or major version is an open decision. - A consumer inventory should report sites with brand overrides before the default change is published.
Implementation plan
Phase 1, in dependency order. Each step names its owning checker.
- Tokenize Slate leaks. Landing primary button, grid, glow, scrims, print
colours, asciinema surfaces; add
--td-preset-accent,brandfont role, and per-preset canvas luminance incontrast-on-canvas.html. Slate output must stay byte-for-byte equivalent in computed colour. Checkers:check-landing.py,check-output.py,check-font-tokens.py. - Vendor IBM Plex Sans.
third_party/,VENDOR.json, licence file. Checker:check-vendor.py. - Preset tokens. New
assets/scss/td/_presets.scss(imported after_brand.scss); the implementation keeps Paper in that file instead of a separatepresets/_paper.scss. After v1.5.1 the file is the plain CSS layerassets/css/td/presets.css, listed afterbrand.css. Place preset font roles before thesystemtypography reset. Checkers: extendcheck-font-tokens.py(Plex Sans family, system block order, token parity between light and dark blocks). - Configuration.
hugo.yamldefaults (preset: paper,preset_menu: false); a resolver partial used byvalidate.html,document-attrs.html,layouts/404.html, andhead.html(init script,theme-color, pre-paint canvas). Regenerate the schema. Checkers:check-params.py(accepted, invalid, reserved),generate-config-schema.py --check,check-namespace.py. - Appearance menu. Shared partial used by
navbar.html,shell/footer-line.html, and the Landing mobile drawer;preset.jsruntime (or a section ofdark-mode.js);dark-mode.jsradio sync; palette actionswitch_preset; i18n strings in all 32 catalogs. Checkers:check-shell.py,check-actions.py, i18n checker,tests/js/preset.test.js,tests/js/dark-mode.test.js. - Third-party surfaces. Per-preset giscus stylesheets and re-post.
- Documentation. EN/ZH architecture, shell and landing contracts; brand guide (presets, migration, fonts); configuration reference; changelog and upgrade note.
- Site validation.
make -C ../oink.pgsty.com check,browser(add preset switching, persistence, storage failure, no-JS, EN/ZH, desktop/mobile, light/dark cases), anddevfor visual review.
Acceptance criteria
The following are the original acceptance targets. Executed checks and remaining limits are recorded separately in the October 5 acceptance record:
- With no
presetkey, output carriesdata-td-preset="paper"and renders Paper with JavaScript disabled. preset: slateproduces computed colours and font roles equal tov1.1across the checker fixtures.- Switching style never changes
td-color-theme; switching mode never changestd-preset; both survive navigation, reload, and language switch. - Invalid stored values are removed; storage failure leaves the page usable and shows the non-persistence note.
- No first-paint flash between presets in Chromium, Firefox and WebKit at normal and throttled CPU.
- Scroll position after a switch stays within one line of the anchor.
typography: systemtriggers no font request in any preset;params.ui.fontsoverrides preset faces.theme_coloroverrides the accent in both modes under Paper and Slate.- The menu is fully operable with keyboard, touch, and screen readers; axe reports no new violations.
- All palettes meet the contrast table in both modes.
- Presets add no external font or script dependency; explicitly configured services such as Giscus remain separate.
Open decisions
- Resolved for phase 1:
preset_menu: false; the docs site enables it. - Target resolved for release preparation:
1.2.0, with a prominent Paper-default notice and thepreset: slatecompatibility setting. Published in 1.2.0. - Resolved for phase 1: the wordmark role is
brand. - Whether a display-only serif becomes a Paper option after phase 1.
- Whether charts (Mermaid, ECharts) should take preset colours in phase 2.
Ink and Terminal backlog
Implemented experimentally: both palettes, existing font roles, prose link and selection signals, heading treatments, scoped geometry, compact Terminal navigation, Giscus palettes, print and the existing switching mechanism. No new font file, animation or runtime is added. See the experiment record for actual output and verification.
Before stable promotion, review long-page red accent density and CJK underline weight in Ink; numbered headings, mono wrapping and dense parameter tables in Terminal; Windows/Android fallback faces and manual screen-reader speech. Mermaid/ECharts and API vendors remain mode-only for this experiment. Wider geometry/density tokens and preset-colored charts require a separate decision.
Decision log
| Date | Change |
|---|---|
| 2026-10-04 | Draft created with Paper/Slate phase-1 scope, Ink/Terminal research specs, Appearance menu choice, and token architecture |
| 2026-10-05 | Phase 1 implemented locally; defaults, brand role and mode-only chart scope accepted |
| 2026-10-05 | Subsequent explicit Ink/Terminal experiments implemented; stable menu policy retained; design acceptance remains open |
| 2026-10-05 | Release preparation targets 1.2.0; simplified Style/Light controls and current-state icons replace the earlier swatch proposal |
16 - Stabilizing Ink and Terminal for reading
Enlarged text overflows the shared footer in the October 26 probe: at 320px with a 32px root/default font, English Ink reached 424px document width and Terminal 408px. OINK v1.7.0 later revised the typography of Ink (system serif / Song prose) and Terminal (all-mono screen, IBM Plex Sans print) — see the architecture contract and accepted decision for current behavior. Neither preset is yet promoted from explicit opt-in to the default pair.
Status, ownership and scope
Status and date: Draft, 2026-10-26; proposed design direction, not an implementation contract
Accountable owner: OINK maintainers; separate recorded acceptance for each preset
Delivery owners: Theme maintainers own CSS, resolvers and focused checkers; documentation maintainers own bilingual contracts, real-site fixtures and browser review; accessibility reviewers own manual task evidence
Baseline: OINK v1.4.0; local source identity and dirty-snapshot limits are recorded in the research
Affected surfaces: Architecture, Components, Shell, Landing and the visual preset decision
Release intent: A later release, subject to refinement and independent acceptance; no new preset recommended
Context and evidence
Ink and Terminal already exist as explicit experiments. Their shared shell is an advantage: readers retain navigation, search, appearance controls and content semantics when changing style. Their remaining problems are repeated decoration, typography outside ordinary prose, inconsistent owned geometry, and incomplete acceptance. Ink is already neutral sans editorial; making it serif would consume Folio’s separate territory. Terminal should become a readable engineering handbook, retaining mono technical roles alongside proportional explanations.
The dated research distinguishes source facts, measurements, design judgments and a limited CSS overlay. Normal-size measurements, spacing probes and focused checks are encouraging, but the whole-document footer failure survives them. Manual 200% text-resize and 400% browser-zoom checks remain separate from the 32px font-preference probe.
Goals and explicit exclusions
| Preset | Audience and primary task | Distinct identity within the same shell |
|---|---|---|
| Paper | Broad documentation readers; guides and sustained reading | Warm Plex Sans reading surfaces and restrained rounded components; remains the default |
| Slate | Existing technical/product sites; reference navigation and product presentation | Established cool palette, Inter/Chakra/Plex roles and richer Landing presentation; compatibility choice |
| Ink | Editors, authors and readers of essays, design rationale and long documentation | Neutral Inter/CJK sans, square flat surfaces, visible prose underlines and sparse red or authored accents |
| Terminal | Engineers and operators; procedures, configuration lookup and code explanation | Plex Sans explanations, mono headings/controls/identifiers, teal/mint links, amber emphasis and flat 2px geometry |
Both candidates must work across Docs, Book, Blog, galleries, Expo and Landing in EN/ZH, light/dark and narrow/wide views. Neither is a separate shell, accessibility mode or table-density mode. Exclude new renderers, global spacing changes, font downloads, runtime dependencies, terminal effects, moving selection tracks, raised Tabs, boxed Field names and Paper heading tails.
Two optional concepts remain outside 1.4 scope:
| Concept | Distinct future purpose | Cost and disposition |
|---|---|---|
| Folio | Academic/book publishing: serif reading roles and scholarly captions/notes, sans navigation/search, mono code | Requires a matched EN/ZH serif strategy, licensing, local font payload and fallback/print/device acceptance. Keep the shared shell; no imported margin-note column. Credible future study, not an Ink replacement. |
| Canvas | Playful geometric presentation for creators: existing sans faces, controlled lilac/ochre accents and a few geometric markers | No inherent font cost, but added palette/state/shape rules, asset guidance, menu and full regression coverage. Evidence is weaker and overlap with Slate is substantial. Defer until creator tasks justify it. |
Proposed behavior and boundaries
Preserve the palette, assign each role
Retain these source colors initially. Values below are light/dark pairs, not a new configuration authority; the preset stylesheet remains the implementation owner: _experimental-presets.scss in v1.4.0, and assets/css/td/experimental-presets.css after v1.5.1. Refine repetition before changing hue.
| Role | Ink light / dark | Terminal light / dark |
|---|---|---|
| Canvas | #ffffff / #0b0b0b |
#f4f5f2 / #0c0f0e |
| Body | #141414 / #ededed |
#1d211f / #d3dbd6 |
| Emphasis | #000000 / #ffffff |
#111713 / #edf4ef |
| Secondary text | #474747 / #b5b5b5 |
#4a514d / #9aa59f |
| Tertiary text | #636363 / #8f8f8f |
#606b63 / #8b9990 |
| Secondary surface / code header | #f4f4f4 / #161616 |
#e9ebe6 / #141a18 |
| Tertiary surface | #ffffff / #161616 |
#f8f9f6 / #18201c |
| Code block | #fafafa / #111111 |
#ffffff / #0a0d0b |
| Link | #141414 / #ededed |
#0a6560 / #4cc9bd |
| Hover link | #c8102e / #ff5c4d |
#084f4b / #7de0d7 |
| Default accent | #c8102e / #ff5c4d |
#935400 / #f0a73a |
| On-link foreground | #ffffff / #0b0b0b |
#ffffff / #0c0f0e |
| Ordinary border | Body RGB at 24% / 24% | Body RGB at 32% / 32% |
| Strong line | Body RGB at 55% / 50% | Body RGB at 55% / 55% |
| Inline code | Body foreground; body RGB fill 5% / 6% | Body foreground; body RGB fill 5% / 7% |
Success, warning, error and information retain their semantic tones, icons and labels. Red is not every Ink status; mint is not every Terminal status. Keep neutral badges distinguishable from success. Decorative separators may remain subtle; required control boundaries need independent contrast measurements.
Authored theme_color remains authoritative for accent surfaces. Actual documentation uses blue #245f94/#5da2dd, Book orange #9a3412/#fb923c, and Blog violet #6d28d9/#a78bfa. These do not replace the link/code text roles. Review both authored accents and preset defaults.
Keep reading roles and verify actual fallback
| Role | Ink default | Terminal default |
|---|---|---|
body |
Inter + platform sans | IBM Plex Sans + platform sans |
ui |
Inter + platform sans | Code role: IBM Plex Mono + mono fallbacks |
heading |
Body role | UI role |
code |
IBM Plex Mono + mono fallbacks | IBM Plex Mono + mono fallbacks |
display |
Heading role | Heading role |
meta |
UI role | UI role |
brand |
UI role | UI role |
print |
Body role | Body role |
Book captions, table descriptions and human-readable search titles/excerpts use the body role. Authored chapter numbers retain their meaning and follow their heading’s role. Technical paths, command controls and identifiers remain mono in Terminal. Field names stay unboxed, at weight 600. Descriptive Terminal table headers move to body 0.875rem/600; ordinary prose retains 1rem/1.7 and the shared reading measure. Display titles retain page-specific scale and wrap; do not shrink mobile prose to accommodate mono chrome.
The existing sans fallback order is -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans SC, generic sans-serif and emoji. The mono list follows IBM Plex Mono with SFMono-Regular, Cascadia Code, Roboto Mono, Menlo, Consolas, Liberation Mono, Sarasa Mono SC, Noto Sans Mono CJK SC and generic monospace. Listed names do not install fonts. YaHei precedes Segoe and can supply Latin too. Chinese glyphs need not occupy Latin mono cells. Preserve language metadata, typography: system, explicit roles and, in releases up to 1.5.1, legacy Sass precedence; inspect loaded, blocked, system and overridden font conditions on actual Windows/Android. (Font matching)
Establish hierarchy and language-sensitive links
Compare Ink article h1 at weight 750/tracking -.025em, h2/h3 at 700/-.012em, and a 1px strong-token top rule instead of the current heavier rule. Chinese headings use zero tracking. Remove enforced uppercase/tracking from minor headings, table headings and callout titles. Terminal headings use 600/zero tracking; remove generated ##/### and callout brackets while preserving authored Book numbers, semantic labels and heading anchors. No fake prompts, blinking cursor effects or decorative heading tails.
Ink prose links remain natively underlined at rest, including lists, notes and citations. Terminal retains a persistent non-color link distinction; verify its existing semibold cue in real prose and use native underlines where that cue is insufficient. Navigation relies on its location and persistent current-state marks. Hover must not change layout, weight or hit area. (GOV.UK links)
Underline geometry remains a review decision. The overlay uses max(1px, .06em) thickness, .22em offset, with a Chinese .25em/skip-ink: none comparison. A blanket .25em rule is not accepted. Compare English .12–.18em and Chinese text-underline-position: under with only 0–.06em extra offset, starting with skip-ink: auto. Scope by actual language, including Chinese blocks inside English pages. Test mixed glyphs, punctuation, descenders, inline code and wrapped links; no line may collide with glyphs or adjacent lines. (CSS Text Decoration draft)
Make component states coherent
Owned component corner radii: Ink 0px, Terminal 2px, no elevation shadows; include FileTree’s currently hard-coded 0.6rem corner radius. Preserve image, avatar, status-dot and vendor geometry.
Current/selected: Ink keeps a static accent rail; Terminal keeps neutral inverse rows/marker. Programmatic state remains. Hover, selection and keyboard focus stay distinct; no traveling pill.
Focus: Immediate static indicator, independently measured on every adjacent surface, visible in forced colors; no global outline reset.
Text selection: Start from current authored-accent fill at 22% light/35% dark; measure composited text/inline-code pairs. Change through the owning role if needed; do not assume the opacity passes.
Tabs: Flat labels, static bottom selection rule, separate focus; no raised active tab. Preserve keyboard, hash/storage behavior, long labels and touch hit areas.
Fields and inputs: Unboxed technical Field names; descriptions remain prose. Actual input controls retain persistent labels, identifiable boundaries and associated error text; placeholder alone is insufficient.
Code and tables: Quiet single frame; preserve syntax semantics, comments, copying, captions, header associations and numeric alignment. Descriptive headers can wrap; no whole-table uppercase. Preserve authored width/overflow policy and local scroll access.
Notes, quotes, footnotes: Keep essential text visible; restrained semantic marker/rule, close attribution and usable reference/backlinks. No oversized quote ornaments, blanket Chinese italics or added margin column.
Cards, steps, badges, disclosures: Stable labels and geometry; distinguish clickable from static content, keep real step numbers, native disclosure semantics and labeled states.
Search and appearance: Body-role result titles/excerpts, mono technical paths; readable matching/selected/muted text. Preserve dialog focus/return, IME editing, loading/error/no-results feedback and reachability with a mobile keyboard.
Landing, Blog/gallery, Book, Expo: Preserve existing composition and media behavior; fit display titles, captions, bylines and utilities into each reading task. Do not turn image surfaces into squared global resets.
Preserve output, vendor and security boundaries
Mermaid/ECharts remain mode-only; API widgets retain vendor palettes and their existing mode behavior. Do not add preset recoloring inside vendor DOM. Giscus automatic palettes follow preset and mode; explicit overrides remain authoritative, but blocked remote frames are not accepted by this review. Print keeps the light preset on white paper; no-JavaScript output keeps the site-default light palette and readable content. Markdown/RSS preserve semantic content without decorative prefixes or control leakage. Keep existing escaping, validated font/color inputs, local assets and appearance storage behavior; no new network permission or script dependency.
Compatibility and migration
Keep preset names, independent mode/style state, shell columns, breakpoints, content syntax and author overrides. Retain Paper as default and maintained consumers’ explicit [paper, slate, ink, terminal] menu. A refinement can ship while a preset remains experimental.
Promotion changes the meaning of preset_menu: true: it offers stable presets plus the site default, so promoting either experiment expands that automatic set. Make that change explicit in layouts/_partials/preset-config.html, its checker and bilingual configuration/release guidance. Explicit lists retain their chosen membership. Promotion requires per-preset maintainer acceptance, not a status-label edit. Preserve reserved Folio/Canvas warning/fallback behavior.
Implementation and owning-checker plan
| Stage / owner | Work and evidence |
|---|---|
| Shared repair / shell maintainer | Fix footer shrink/wrap behavior at its owner; add whole-document scroll-width and visible-content assertions through the footer for all four presets. Avoid clipping or hiding overflow as a remedy. |
| Refinement / theme maintainer | Implement reviewed changes in existing preset, typography and component owners. Start with bin/check-presets.py, bin/check-font-tokens.py and affected component/output checks; preserve frozen Slate. |
| Integration / documentation maintainer | Extend appearance, font, component and text-reflow suites on real EN/ZH pages; include full-page checks and annotated visual review. Run sibling-source make check, make browser, and make dev review. |
| Promotion / maintainers and reviewers | Close the gates below; update owning implementation/checker and affected EN/ZH contracts together, then record durable rationale and user-facing migration guidance. |
Runtime edits additionally require node --test 'tests/js/**/*.test.js'; schema edits require python3 bin/generate-config-schema.py --check.
Acceptance gates and open decisions
Distinguish accessibility requirements from project targets
WCAG 2.2 A/AA is the baseline (references accessed on 2026-10-26).
| Gate | Required assessment |
|---|---|
| Text and controls | Normal text 4.5:1; qualifying large text 3:1 (24px regular or 18⅔px bold, equivalent CJK sizing). Required control/state cues 3:1 against adjacent colors; decorative dividers are different. Include code comments, placeholders and every selected/hover state. (1.4.3, 1.4.11) |
| Reflow and resizing | Independently test 320 CSS px reflow, manual 200% text enlargement and 400% browser zoom from a 1280px viewport. Necessary two-dimensional regions require individual justification; code/tables are not blanket exemptions. Also close the separate 320px/32px-font stress blocker. (1.4.10, 1.4.4) |
| Spacing | Tolerate simultaneous line-height 1.5, paragraph-after spacing 2em, letter spacing .12em and word spacing .16em without loss. These are user overrides, not default typography; assess applicable Chinese/mixed-script properties. (1.4.12) |
| Keyboard and meaning | Visible focus; focused controls not entirely obscured by authored content; non-color state cues; correct language, headings, labels and table relationships. Character shortcuts need disable/remap/focus-only handling, not merely suppression in text inputs. Announce applicable search statuses without moving focus. (2.4.11, 2.1.4, 4.1.3) |
| Target minimum | AA uses 24×24 CSS px or a qualifying exception. For its spacing exception, a 24px-diameter circle centered on each undersized target must intersect neither another target nor another undersized target’s circle; inline, equivalent, user-agent and essential exceptions also exist. (2.5.8) |
| Proposed stronger targets | Routine touch controls 44×44px; main text 7:1; whole focused control/ring visible; static indicator at least a 2px-perimeter area with 3:1 change at the same pixels, plus adjacent-color contrast. These go beyond AA and need explicit adoption; they do not imply whole-page AAA. (2.5.5, 1.4.6, 2.4.13) |
Record complete tasks before promotion
Require both languages and modes at 320/390/768/1440px, with normal, enlarged and overridden text. Review long pages at top/middle/footer, heading/Book numbering, URLs, Fields, tables, code, search, appearance, media and Landing. Inspect rest/hover/current/selected/focus/text-selection, forced colors, reduced motion and no-JavaScript/print/Markdown/RSS. Record actual color pairs and human review of axe incompletes.
Actual Windows Chrome/Edge and Android Chrome font/rendering work remains pending, as do branded macOS/iOS Safari checks. Record device/OS/browser/font conditions. Pending manual tasks use NVDA on Windows, VoiceOver with actual Safari, and TalkBack on Android: traverse headings and meaningful numbers, read tables/field errors, search with Chinese input, hear concise status feedback, open/close dialogs and regain focus.
Open decisions are the Chinese underline treatment, stronger project targets, any state-specific color repair, and the promotion of each preset. If gates remain incomplete, retain experimental status or defer refinement; unrelated 1.4 work need not wait for new styles.
Decision log
| Date | Proposed decision and status |
|---|---|
| 2026-10-26 | Keep Ink neutral sans editorial and Terminal a readable engineering handbook; preserve current palettes and author accents. Direction recommended; no stability acceptance. |
| 2026-10-26 | Prioritize shared enlarged-font footer repair; keep flat Tabs, unboxed Fields and no Paper tails. Remove decorative Terminal punctuation through existing owners. |
| 2026-10-26 | Chinese underline alternatives and stronger accessibility targets remain review decisions; exploratory probes do not close promotion gates. |
| 2026-10-26 | No new preset for 1.4; Folio/Canvas remain distinct future concepts. Per-preset promotion and automatic-menu expansion require explicit acceptance. |
17 - Ink and News: the written page and the printed page
Most of this proposal is implemented and ships in OINK v1.8.0; three parts remain open, see the implementation record. Current behavior is defined by the architecture contract and the visual presets decision.
Status and surface
Status and date: drafted 2026-11-28 and partly implemented in OINK v1.8.0
Owner: OINK maintainer
Baseline: OINK v1.7.0 plus the v1.8.0 preset pass: newsprint is renamed
news; the menu puts Paper, Slate and GitHub above Ink, News and Terminal; dark Terminal
becomes a phosphor screen; Ink takes Kai headings, Song text and Palatino for Latin. The
visual presets decision records these changes.
Affected contracts: Architecture · Visual presets, Visual presets decision
Affected implementation: assets/css/td/tokens-typography.css, assets/css/td/brand.css
(local font aliases), assets/css/td/experimental-presets.css, assets/css/td/print.css,
layouts/_partials/_funcs/preset-canvases.html, assets/css/giscus-ink-*.css,
assets/css/giscus-news-*.css, bin/check-presets.py
Release intent: OINK v1.8.0; both presets stay explicitly selected
Context and evidence
Four of the six presets have settled roles. Paper is the default warm paper surface, Slate is the technical look OINK has had since 1.1, GitHub reproduces how GitHub renders a README, and Terminal is a terminal: an engineering handbook in light mode and a phosphor screen in dark mode. The remaining two, Ink and News, both draw on paper and serif type, and they blur together.
- Ink in 1.7.0 is a sans-serif editorial style: white ground, black text, a red accent. It reads like Hextra and other modern documentation themes, and it is hard to tell apart from Paper and GitHub. The working-tree draft turns it into brush writing.
- News is the ivory Paper of 1.7.0, after Typora’s Newsprint theme. Its serif text, Song, Kai quotations and ivory sheet overlap heavily with a brush-written Ink. The draft dark News is an evening paper by candlelight: a warm brown ground, parchment-colored text and gold links, which uses the parchment and gold that Ink wants.
This proposal draws one line between them: Ink is written, News is printed.
Font coverage
The theme ships no font files and can only name fonts the reader already has. What each platform preinstalls decides how many readers see the design as drawn. The table follows the official font lists of Microsoft, Apple, AOSP, Ubuntu and Fedora as of 2026-11-28. “With Chinese” means the Chinese (Simplified) Supplemental Fonts that Windows installs when Chinese is added; “on demand” means a download, which macOS may make by itself when the system language is Chinese, though Apple does not document it.
| Font class | Windows, Chinese | Windows, English | macOS | iOS / iPadOS | Android | Linux desktop |
|---|---|---|---|---|---|---|
| Hei (sans) | Microsoft YaHei | Microsoft YaHei | Hiragino Sans GB, STHeiti (PingFang on demand since macOS 15) | PingFang (on demand) | Noto Sans CJK | Noto Sans CJK |
| Song (serif) | SimSun | SimSun | Songti SC (preinstalled) | Songti SC (on demand) | Noto Serif CJK, only as the serif fallback |
Noto Serif CJK |
| Fangsong | FangSong | none (with Chinese) | STFangsong (on demand) | on demand | none | none |
| Kai | KaiTi | none (with Chinese) | Kaiti SC (on demand) | on demand | none | AR PL UKai on Ubuntu installed in Chinese |
| Palatino | Palatino Linotype | Palatino Linotype | Palatino | Palatino | none | URW P052 |
| Calligraphic | Gabriola, Segoe Script | same | Apple Chancery, Zapfino, Snell Roundhand | Zapfino, Snell Roundhand (Apple Chancery on demand) | Dancing Script, only as cursive |
URW Z003 |
| Newspaper serif | Times New Roman, Georgia | same | Times New Roman, Georgia, Charter, Didot | Times New Roman, Georgia, Charter, Didot | Noto Serif | Liberation Serif |
Three conclusions follow:
- No Chinese face exists on every platform. By class, only Hei is everywhere; Song is nearly everywhere except iOS, where Chinese serif text probably falls back to PingFang; that is unverified.
- Fangsong and Kai have identical reach. Chinese Windows has both, macOS readers must download them, and phones and most Linux systems have neither. “Fangsong first, Song as the fallback” therefore works, but only readers on Chinese Windows or a Mac with the font downloaded see Fangsong. Everyone else sees Song.
- Lookup by name and
local()give different results. On 2026-11-28, on a Mac where Kai had been downloaded, WebKit did not matchfont-family: "Kaiti SC"while Chromium did. Through an@font-facealias withlocal("Kaiti SC"), both engines matched it. The theme’sOINK Kaialready uses an alias; Fangsong should do the same.
Goals and non-goals
Goals
- Ink and News are distinguishable at a glance in light and dark mode, on Chinese and Latin pages.
- Each has its own dark mode. Dark mode changes colors and a few details, never fonts.
- The six dark modes do not collide: Slate and GitHub already hold blue-black, Paper holds warm grey, and Terminal holds phosphor green.
- When Kai and Fangsong are missing, the two presets stay distinguishable; the style must not rest on fonts alone.
Non-goals
- No font files, image assets or runtime scripts.
- No vertical text, ink-wash backgrounds, cloud ornaments, images of brush lettering or seal images.
- No changes to Paper, Slate, GitHub or Terminal.
- No configuration renames:
inkandnewsstay as they are.
The dividing line
| Aspect | Ink · written | News · printed |
|---|---|---|
| Metaphor | A scroll written by one hand: xuan paper or parchment | A page set in columns by machine: newsprint and press ink |
| Rhythm | Open: one column, a deep top margin | Dense: masthead, kicker, deck, column rules |
| Hierarchy by | Changing the letterform: Kai, italic, a red initial; no bold | Changing weight: heavy headlines, light decks, thick-and-thin rules |
| Chinese | Kai headings, Fangsong text (Song when missing), red emphasis dots | Bold Song headlines (heavy Hei on Windows), Song text, bold emphasis |
| Latin | Palatino text and italic headings; calligraphic faces only for titles, initials and the wordmark | Charter / Georgia text, Times New Roman Bold headlines, a Didot masthead |
| Color | Paper with two inks: black and vermilion | Grey newsprint, press black and one spot blue |
| Where the reader is | A vermilion dot | A black column rule and bold |
| Dark mode | Gold on indigo paper | Darkroom |
When Kai and Fangsong are both missing, Ink’s Chinese falls back to Song, the same class News uses. Four differences remain: Ink headings stay at regular weight with open spacing while News headlines take the heaviest weight with tight spacing; Ink marks emphasis with vermilion dots while News uses bold; Ink has a paper color with a radial shade while News is flat grey newsprint; Ink has no rules while News has them everywhere.
Ink: the written page
Type
| Role | Chinese | Latin | Note |
|---|---|---|---|
| Display (page title, Landing hero) | OINK Kai |
Apple Chancery → Gabriola → URW Z003 → Palatino Italic | Calligraphic faces at large sizes only; never the generic cursive, which Chrome on Windows resolves to Comic Sans |
| Headings (h2–h4) | OINK Kai |
Palatino Italic | Zapf drew this italic from Renaissance chancery hands |
| Text | OINK Fangsong → Song |
Palatino → Palatino Linotype → URW P052 → TeX Gyre Pagella | Fangsong is enlarged 8%, for Han only |
| Quotation | OINK Kai |
Palatino Italic | The shared quotation role |
| Interface (navigation, search, menus) | Platform Hei | Platform sans | Song and Kai thin out at control sizes |
| Code | Shared mono | Shared mono | Unchanged |
- Add an
OINK Fangsongalias. It followsOINK Kai:local()names STFangsong, then Windows FangSong;unicode-rangecovers only Han and full-width punctuation; andsize-adjust: 108%makes up for Fangsong’s light, small design. Both Fangsong faces have only a regular weight, so emphasis does not use bold (see the emphasis dots below). - Kai headings stay at regular weight. Only macOS Kaiti SC has a true bold; Windows KaiTi does not, and synthesized bold looks poor. Headings rank by size and space.
- No Papyrus. It is the best-known overused “ancient” typeface, and Windows, Android and Linux do not have it. For a rougher look, Luminari and Trattatello on macOS can serve as display alternatives, outside the default stack.
Color
The light palette, “xuan paper and vermilion”, uses a manuscript’s two inks: black for writing and vermilion for marking.
| Token | Value | Contrast on the darkest edge #e8dabd |
|---|---|---|
| Paper (canvas) | #f3ead7 |
— |
| Paper edge (end of the radial shade) | #e8dabd |
— |
| Code ground | #e9dcc1 |
— |
| Ink (text) | #241a10 |
12.35:1 |
| Light ink (secondary) | #574634 |
6.52:1 |
| Pale ink (tertiary) | #6e5c47 |
4.63:1 |
| Vermilion (accent) | #a8321b |
4.84:1 |
| Seal (wordmark ground) | #b8371d, paper-colored text |
4.88:1 |
Links keep the text ink with a vermilion underline and turn vermilion on hover.
Details
- Vermilion dot: the current navigation item gets a vermilion dot instead of a tinted row.
- Emphasis dots: Chinese
strongis not bold. It takestext-emphasis: filled dotin vermilion under each character, the traditional Chinese mark of emphasis, scoped to:lang(zh). The cost is that Latin letters inside the samestrongget dots too. - Initial: the first letter of the first paragraph is set three lines tall in a calligraphic face and vermilion, in Blog and Book text only, not Docs. Its float uses logical properties, so RTL pages mirror it.
- Seal: the wordmark may sit in a vermilion box like a seal impression. This is the detail most likely to look kitsch; whether it is on by default is open.
- Paper: a radial shade lies over the canvas, paper-colored at the center and slightly darker at the edges. No noise image; print drops it.
- Top margin: more space above the page title.
- Red stays small: dots, emphasis marks, the initial, the seal and underlines. Headings are never red; Fangsong text under a red title reads as a Chinese government circular.
The brush details already in the working-tree draft (a tapered stroke opening each section, a
short dash for hr, quotations hung on a fading vermilion stroke) fit this direction and can
stay.
Dark: gold on indigo paper
This palette follows sutras written in gold and silver on deep indigo-violet paper. East Asia wrote sutras in gold on indigo paper and Europe wrote gold on purple parchment, two traditions that arrived at the same practice, so the palette suits Chinese and Latin pages alike.
| Token | Value | Contrast on the darkest edge #120f22 |
|---|---|---|
| Indigo paper (canvas) | #1b1730 |
— |
| Paper edge | #120f22 |
— |
| Code ground | #241f3d |
— |
| Silver (text) | #e3ddd0 |
13.89:1 |
| Gold (headings and accent) | #dcb766 |
9.85:1 |
| Secondary | #b4ad9f |
8.43:1 |
| Tertiary | #958e82 |
5.79:1 |
| Seal, lifted | #e06a4c, text in the paper color |
5.23:1 |
The initial, emphasis dots and the current-position dot turn gold. The seal stays red, as collectors’ seals on such sutras are.
The draft dark Ink is a stone rubbing: a blue-black ground, paper-colored text and a vermilion
seal. It ties more directly to calligraphy, since calligraphers learn from rubbings, but its
palette is close to a generic dark theme and hard to tell from Paper’s warm grey dark
(#161513). This proposal recommends gold on indigo and keeps the rubbing as the alternative.
News: the printed page
Type
| Role | Chinese | Latin | Note |
|---|---|---|---|
| Masthead (wordmark) | Bold Song | Didot → Bodoni 72 → Times New Roman | Only macOS has Didot |
| Headlines | Songti SC Black / Bold → Microsoft YaHei Bold | Times New Roman Bold | Times was drawn for The Times |
| Text | Song | Charter → Iowan Old Style → Georgia → Cambria | The current stack |
| Kicker, byline, table heads, interface | Platform Hei | Platform sans, uppercase and spaced | Papers set section labels and datelines in a sans |
| Quotation | OINK Kai |
Serif italic | As today |
The deck (the page description) is italic in Latin. Han has no true italic, so a Chinese deck stays upright.
Color
The light palette, “newsprint”, is grey newsprint, press black and a single spot color.
| Token | Value | Contrast on the code ground #e6e3da |
|---|---|---|
| Newsprint (canvas) | #f0eee8 |
— |
| Code ground | #e6e3da |
— |
| Press black (text) | #161616 |
14.10:1 |
| Secondary | #4a4844 |
7.11:1 |
| Tertiary | #625f59 |
4.96:1 |
| Spot blue (links and accent) | #1f4f7a |
6.66:1 |
The current clay accent (#9b4a28) and Ink’s vermilion are both red-brown and hard to tell
apart side by side, so News moves to a single spot blue. The newsprint is greyer and darker
than Paper’s #f7f6f3, and further from Ink’s yellower paper.
Details
- Masthead: a double rule under the site header. The specimen’s date and edition between the lines would need new markup and are not implemented.
- Kicker, deck and byline: the section name as a kicker above the headline in spot color
and capitals; the page description as a deck below it; the byline and date between two thin
rules. The current markup has the deck (
.lead) and the date line (.td-article-info) but no kicker, which would need new markup and is not implemented. - Thick-and-thin rule: a heavy rule over a thin rule above each h2, in place of Ink’s brush stroke.
- Pull quote: a heavy rule above and a thin rule below, a step larger, with no left bar. Quotations in documentation often run to several paragraphs, and centering would hurt them, so they keep their start alignment.
- Column rules: Blog lists and section indexes set in columns with
column-ruleon wide screens. Article text stays in one column, because code blocks do not survive columns. Blog lists switch between cards, a table and a gallery at runtime, so columns are not implemented. - Tables: a press-black rule above and below, tabular figures, uppercase heads.
- Where the reader is: a black column rule and bold on the current navigation item, with no color.
- No drop cap: the initial belongs to Ink.
Dark: the darkroom
The darkroom where a newspaper developed its photographs: true black, the grey of silver prints and the orange of the safelight.
| Token | Value | Contrast on the code ground #1a1a1a |
|---|---|---|
| Ground | #0f0f0f |
— |
| Code ground | #1a1a1a |
— |
| Silver (text) | #d8d6d1 |
11.98:1 |
| Headlines | #f3f1ec |
15.42:1 |
| Secondary | #a4a19a |
6.75:1 |
| Tertiary | #8a877f |
4.85:1 |
| Safelight orange (links and accent) | #f2804a |
6.60:1 |
A faint orange radial glow (7% opacity) sits in the top corner, on screen only. Safelight orange sits about 20° redder than Ink’s dark gold and is more saturated, so the two stay distinct side by side.
The draft evening paper by candlelight uses a warm brown ground, parchment text and gold links, and parchment and gold belong to Ink in this proposal. Its warm brown is also close to Paper’s dark ground. This proposal recommends the darkroom. If a monochrome mood is preferred, microfilm is the alternative: a neutral black ground, silver-grey text and the spot blue lifted for links.
The six dark modes
| Preset | Canvas | Text | Accent | Image |
|---|---|---|---|---|
| Paper | #161513 |
#ece9e3 |
#7db5e6 |
Warm grey |
| Slate | #0b1119 |
#e8eef6 |
#5da2dd |
Cool blue-black |
| GitHub | #0d1117 |
#f0f6fc |
#4493f8 |
Primer dark |
| Ink (proposed) | #1b1730 |
#e3ddd0 |
#dcb766 |
Gold on indigo paper |
| News (proposed) | #0f0f0f |
#d8d6d1 |
#f2804a |
Darkroom |
| Terminal | #020703 |
#7ee89a |
#3dff7a |
Phosphor screen |
Other scripts
Ink’s principle of writing applies to every script: the display and heading roles use an
installed face from that script’s calligraphic or handwritten tradition, and the text uses
the script’s book face. Where no such face exists, the book face is enough. Japanese and Korean
would need their own :lang(ja) and :lang(ko) stacks, or Han characters take Chinese forms.
Preset font roles may only sit on the bare root selector, so that typography: system and
params.ui.fonts still override them, so those stacks are not implemented and Japanese and
Korean keep the theme’s existing handling. The Arabic and Hebrew calligraphic faces join the
heading stacks by glyph fallback, which gives Persian Thuluth rather than Nastaliq.
| Script | Display and headings | Text |
|---|---|---|
| Japanese | Kyokasho (Windows UD Digi Kyokasho; macOS on demand) | Mincho |
| Korean | Gungsuh (Windows; macOS on demand) | Myeongjo / Batang |
| Arabic | Thuluth (macOS Diwan Thuluth) | Naskh |
| Persian | Nastaliq (Noto Nastaliq Urdu, preinstalled on macOS) | Naskh |
| Hebrew | Corsiva Hebrew (macOS) | System Hebrew serif |
| Cyrillic | Palatino Italic (the calligraphic faces lack Cyrillic) | Palatino |
| Devanagari, Bengali | No suitable calligraphic face; the text face | System face |
News needs no per-script rules: each script uses its book serif and bold headlines.
Output, accessibility and security
- Contrast: every text color is checked against the darkest point of the canvas, the end
of the radial shade, not the paper color at the center.
check-presets.pymust include that end color in its AA checks. - Print: the paper shade, glow, initial color and seal are dropped; print keeps each preset’s existing print palette.
- Forced colors: shades, emphasis-mark color and rule color yield to system colors; the emphasis marks themselves stay.
- RTL: the initial’s float and the navigation dot use logical properties.
- Markdown, LLMS and RSS: unaffected; they carry no preset styling.
- Network and assets: no font files, images or external requests;
local()aliases take effect only where the reader has the font.
Compatibility and migration
inkshipped in 1.7.0. Sites that setpreset: inkor listinkin the menu will see a clear change. It is an explicitly selected experiment, so this is acceptable, butCHANGELOG.mdmust say so.newshas not shipped, so changing it has no compatibility cost.- The reserved name
foliowas held for a serif book style, which overlaps Ink and News as proposed here. Whether to keep the reservation is the maintainer’s decision. - Both presets’ giscus palettes (
giscus-ink-*.css,giscus-news-*.css) change with their palettes.
Implementation and checker plan
- Add the
OINK Fangsongalias inbrand.css, and rewrite Ink’s and News’s font roles intokens-typography.cssas tabled above. - Rewrite Ink’s and News’s light and dark palettes and details in
experimental-presets.css; update canvases and inks inpreset-canvases.htmlto match. - Drop the paper effects in
print.css. - Update the four giscus palettes.
- Add the shade-end AA check and token parity for the new palettes to
check-presets.py. - Review Ink and News on the documentation site in English and Chinese, desktop and phone, light and dark, including the fallback on Windows without Kai or Fangsong.
Acceptance criteria
- With screenshots of all six presets side by side in the same mode, a reviewer can tell each one apart without reading a label.
- Where Kai and Fangsong are absent (iOS, English Windows), Ink’s and News’s Chinese pages are still distinguishable.
- Every text color meets WCAG AA at the darkest point of the canvas; body text reaches 4.5:1.
- Print preview shows no shade, glow or seal.
check-presets.pyandcheck-stylesheets.pypass, and the site’smake checkandmake browserpass.
Implementation record
On 2026-11-28 the theme was changed to this proposal, settling the open questions as it leaned: Fangsong text; the seal on by default, on the site header’s text wordmark only (the sidebar brand of the Docs, Book and Blog shells is untouched); the initial in Blog and Book only; gold on indigo paper and the darkroom for the dark modes; News without clay. Where the implementation departs from the design:
- The display stack adds URW Z003 for Linux.
- Per-language Japanese and Korean stacks, News’s kicker, the date and edition inside the masthead rule, and Blog list columns are not implemented, for the reasons given above.
- Pull quotes keep their start alignment instead of centering.
- The menu icons take each preset’s accent: Ink vermilion, gold in dark; News spot blue, safelight orange in dark.
- A calibration after the maintainer’s review the same night dropped Ink’s calligraphic display faces and seal: Latin is Palatino everywhere and Han takes Kai in headings and the interface. News sets its interface, menus and lists in its text serif and squares its interface parts. The display-face table and the seal detail above no longer apply.
The theme’s check-presets.py, check-font-tokens.py, check-stylesheets.py,
check-goldens.py and other checkers pass. The documentation site build failed at the time
on a parallel change to the Social component, so the site checks run once that change lands.
Open questions
- Does
foliostay reserved?
Decision log
| Date | Change |
|---|---|
| 2026-11-28 | Drafted. Separates Ink and News as the written and the printed page; proposes Fangsong text and calligraphic display faces for Ink, and the gold-on-indigo and darkroom dark modes. The design specimen was made outside the repository and is not part of the site |
| 2026-11-28 | Font coverage corrected against the official font lists of Microsoft, Apple, AOSP, Ubuntu and Fedora |
| 2026-11-28 | Partly implemented in the theme; see the implementation record |
| 2026-11-28 | Calibrated after review: calligraphic display faces and the seal removed; Ink’s and News’s interface fonts unified with their text |