OINK 1.6.0 — Plain CSS, BM25 local search, and leaner runtimes
OINK 1.6.0 removes Sass, Bootstrap’s JavaScript bundle, and Lunr so any Hugo
edition (0.169.0 or newer, including Hugo 0.170+) builds a site with no
external compiler. It replaces local search with a single scanning BM25 engine
supporting unspaced CJK queries, field-level anchors, and automatic split
indexes; upgrades Markmap, ReDoc, Mermaid, KaTeX, DocSearch, and the rest of
the bundled runtime set; adds on-approach engine and comment loading,
single-line navbar overflow, off-path sidebar caching, and WebP blog covers;
and tightens all 32 native locale catalogs.
v1 module pathOINK 1.6.0 stays on github.com/pgsty/oink so existing module paths remain
stable, while retiring the three SCSS hooks, moving published CSS paths from
/scss/ to /css/, and removing Bootstrap JS and Lunr. Review
Breaking changes and upgrade before updating an existing site.
Plain CSS and Hugo 0.170 compatibility
Hugo 0.170 removed LibSass and the Extended edition. Published OINK 1.5.1 fails
on Hugo 0.170 unless Dart Sass is installed separately. OINK 1.6.0 eliminates
Sass completely: the stylesheet is now 118 plain CSS layer files under
assets/css/td/, concatenated by Hugo in cascade order with no compiler and no
generated CSS committed to Git. Production main.css output is byte-identical
to the last Sass-compiled stylesheet, and ordinary builds need nothing but the
Hugo binary in any edition (plus Go 1.27.4 for Hugo Modules).
- Stylesheets now publish under
/css/:css/main.css,css/fontawesome.css, andcss/redoc.css. - Site styles live in plain CSS at
assets/css/project.cssfollowed byassets/css/project/*.cssin path order. The three retired hooks underassets/scss/(_variables_project.scss,_variables_project_after_bs.scss, and_styles_project.scss) are ignored and each emits one build warning viawarnidf. - Site-owned shells that do not load
maincan request named stylesheets (chrome,landing,search,compare) throughpartial "css/bundle.html". bin/check-stylesheets.pyverifies layer lists, bans compiler calls, and builds probe sites with an emptyPATH.
No Bootstrap JS and no Lunr
OINK 1.6.0 drops bootstrap.bundle.js, @popperjs/core, lunr, and the
unused katex.min.js. Core page JavaScript (js/core.js) drops from 92 KB to
under 9 KB minified, and assets/js/third_party/ is removed.
- Version menus in the footer and phone drawer are now CSS-positioned
disclosures owned by
base.js(.td-version-menu__list, with keyboard arrow navigation and Escape handling), and Landingdownloadchannels switch directly inlanding.jsand emittd:tab-shown. - Bootstrap’s component CSS remains in
assets/css/td/bootstrap/, anddata-bs-theme/data-bs-theme-valuecolor-mode attributes continue to work unchanged. Sites whose custom markup relies on Bootstrap JS widgets orwindow.lunrmust load their own scripts.
Scanning BM25 local search
Local search replaces both Lunr and the old substring fallback with one
scanning BM25 engine that builds no index in the browser, eliminating the
first-query stall on large documentation trees while keeping the exact same
configuration keys (params.offline_search*).
- Unspaced CJK and mixed queries. Contiguous CJK runs match as overlapping
bigrams without a dictionary (
数据库连接池超时works without spaces), while CJK/Latin boundaries split automatically. - Word boundaries, identifiers, and symbols. Ordinary words match on word
boundaries (
portno longer matchessupport), with Porter stemming for ASCII words, four-character stems for other alphabets, spelling fallback counting transpositions as one edit, and literal matching for identifiers and multi-character symbol runs such as->>. - Automatic split above 2 MiB. Indexes up to 2 MiB publish unchanged as one
file. Larger
contentindexes automatically keep navigation metadata in the first file and move page bodies tooffline-search-body.<lang>.json. Results from titles, headings, field entries, and keywords appear immediately; body text up to 8 MiB loads automatically, while larger text orSave-Datasessions wait for the reader to choose Search page text. - Field-level search entries. Every anchored field (
{.fields}orfields/field) emitsdata-td-search-entry, andfieldgains an optionalidparameter to preserve legacy anchors such asguc-work-mem. Searching a parameter name opens its definition directly.
Upgraded runtimes and on-approach loading
The vendored runtime inventory (VENDOR.json, now 25 top-level dependencies)
refreshes DocSearch 5.2.0, Mermaid 12.3.0 (preserving dagre / default /
classic defaults), KaTeX 0.19.1 (publishing only the 20 woff2 faces,
cutting formula asset output from 1.1 MB to 0.3 MB), Swagger UI 5.34.1,
Asciinema 3.18.0, Infographic 0.2.20, Pako 3.0.3, idb-keyval 6.3.0,
and Viz.js 3.31.0 (Graphviz 16.1.0 under EPL-2.0).
- Markmap 1.1.0. Replaced the legacy 0.18 autoloader, standalone D3,
highlight.js, and WebFontLoader with scoped
@markmap/*1.1.0 ESM modules and on-demand local MathJax. Notes handle paragraphs, code blocks, and tables with full keyboard access, live theme sync, and source fallback. Options move tofoldLevel,wrapWidth,levelGap,siblingGap, andcolorDepth(old keys warn and are ignored). - ReDoc 3.1.0. Each specification runs in an isolated local HTML reader document with its own hash router and telemetry disabled, preventing multiple ReDoc instances from colliding with article anchors.
- On-approach loading. Asciinema, ECharts, Infographic, Markmap, and Giscus
now load when a reader approaches them (or immediately for
loading: eagerand GitHub sign-in redirects for Giscus), keeping heavy engines off the initial critical path and falling back to readable links or source in browser print and failure states.
Shell, localization, and publishing hardening
- Single-line top navbar overflow. When horizontal space tightens beside
the brand, desktop sidebar, and utility controls, icon-bearing top navbar
items collapse to icon-only mode first (
params.icon: falseor"none"opts out), and any remaining overflow folds into a trailing…disclosure panel (ui_nav_more) with full icons, labels, and child menus. - Faster builds and leaner media. Off-path sidebar branches render once per
build below
sidebar_cache_limitwith byte-identical output. Blog featured images inbanner,hero, andwashmodes re-encode as WebP withfetchpriority="high", and term-page thumbnails crop and lazy-load. - All 32 locales tightened. Proofread all 32 native catalogs (
i18n/*.yaml, 242 keys), fixed cursive RTLletter-spacing(ar,fa), widened the Appearance and Page Actions panels cleanly within 200% zoom bounds, and made the six Giscus preset stylesheets self-contained. - Print, Book, and cache hardening. Added dedicated Print layouts for home,
landing, section, and single pages with a shared
print/page-id.htmlanchor helper; keyed page-scopedpartialCachedcalls by base URL and language; hardened Book target numbering, TOC escaping, and cross-formatbook-*listing determinism; and tightened author input validation and runtime edge cases across Duo View, diagrams, and the command palette.
Breaking changes and upgrade
Before pinning v1.6.0, review the complete checklist in
Upgrade to 1.6.0:
- Upgrade Go to 1.27.4+ and Hugo to 0.169.0+ (any edition; validated on Hugo 0.170.1).
- Convert any
assets/scss/_*_project*.scsshooks to plain CSS inassets/css/project.css, update hardcoded/scss/*.cssreferences to/css/*.css, and switch custom shells topartial "css/bundle.html"(Retired SCSS hooks). - Remove site dependencies on theme-provided
window.bootstrap,data-bs-toggle, orwindow.lunr; switch Landing channel listeners fromshown.bs.tabtotd:tab-shownand version-menu.dropdown-menuselectors to.td-version-menu__list(Bootstrap JS, Local search). - Migrate legacy Markmap 0.18 YAML keys
(Markmap migration), allow
frame-src 'self'in CSP when using ReDoc 3, and scroll lazy components into view in browser tests.
Pin the published module once v1.6.0 is live:
Commit the updated go.mod and go.sum (including the go 1.27.4 directive).
Keep build warnings visible and never enable --panicOnWarning or
HUGO_PANICONWARNING.
