Upgrade
Upgrading OINK means changing the release your site pins and checking what the new release renders differently. Most content needs no edits. Where a release retired a syntax or an interface, its section below says whom that affects and what to change, and a migration tool rewrites old shortcodes in bulk, dry run first. Do the work on a branch, so that abandoning an upgrade costs nothing but the branch.
OINK 1.6.0 and newer use plain CSS and are tested on Hugo 0.170+, so the build compiles nothing. OINK 1.5.1 and older need Hugo’s Extended edition, which ended with Hugo 0.169, so a site on an older release cannot follow Hugo past 0.169 until it upgrades; see Staying on 1.5.1 or older.
Read the release notes first
Each release’s notes list its changes, breaking changes and upgrade steps. Before you change the pin, read the notes of every release between yours and the target:
- Release notes on this site
- Releases on GitHub
They tell you which content needs editing, which configuration keys are gone and which defaults changed, so a page that looks different after the upgrade comes with an explanation.
Upgrading the Hugo Module
Pin a published release tag, or an immutable commit you chose deliberately,
never a branch or @latest, so that building the same site commit always
produces the same site. Check that the tag is published and resolves before
you pin it:
The module graph must show exactly that version; a commit you chose appears in
go.mod as a Go pseudo-version. Commit go.mod and go.sum. For the tag
above, go.mod reads:
If you also preview against a local theme checkout, that replacement overrides the pin; see Previewing against a theme checkout before you trust a build.
For a Git submodule, confirm that it has no local edits, fetch the tags and check out the exact release rather than following a remote branch:
Commit the new submodule pointer once the site passes. For an offline archive
or a clone, replace themes/oink/ with the complete tree of the new release
and confirm that theme: still matches the directory name. The trade-offs
between install methods are in
From scratch and other install methods.
What to do after upgrading
This clears caches that may still hold output of the old release, builds with the pinned release only, with no local replacement or workspace, and prints informational messages along with the warnings. Hugo’s deprecation notices among them say what a future Hugo will remove; resolve them before you upgrade Hugo itself, since how urgent each one is depends on the feature.
Once the build passes, look at the result: the home page, a documentation page, a blog page and the 404, in every language and both color schemes, the print view, and everything the site customizes.
Verify
A passing build does not finish an upgrade. Check each surface the site uses:
Then run the checks a site can run: the production build, the output trust check and, for a book, the anchor check. Deploy a preview and open its pages in a browser at the real URL, watching the network requests. Merge the upgrade only after that review, and smoke-test production once it is live.
Rollback
To roll the theme back, restore the previous pin:
- Keep the pre-upgrade module pin, site commit and known-good deployment artifact, and restore all three together.
- Never roll back part of it. Old layout copies over a new theme make a mixture that is harder to diagnose than either complete release.
- Keep the upgrade branch and what you learned verifying it. A rollback restores production first; it does not throw the upgrade work away.
Republishing the previous deployment itself is covered in Deploy.
Upgrade to 1.8.0
Review the 1.8.0 release notes and check these items before
pinning v1.8.0:
- Six visual presets and distinct dark modes. Paper returns to its classic
warm-paper and link-blue look (
#f7f6f3,#21201c,#2b5f8c, IBM Plex Sans over Hei).githubandnewsjoin the preset list,inkis redesigned as a written page (Palatino, Kai, Fangsong/Song and vermilion; silver and gold on indigo-violet in dark mode), and Dark Terminal is calibrated as a restrained phosphor screen. To offer all six styles, setparams.ui.preset_menu: [paper, slate, github, ink, news, terminal]. See Brand and appearance. - Appearance trigger and menu layout. Three, five or six presets arrange in
three columns above the three Color cards, with
Style (T)andColor (Y)legends when keyboard navigation is on. When the menu offers Color, the navbar trigger shows the reader’s choice. Light uses a sun, Dark a moon, and System a half-filled circle even when the system switches between light and dark. - Unified audio and video controls. Local audio and video files replace
native browser controls with the theme’s
.td-media__controlsrow, featuring a single three-color progress bar, playback speed toggle, volume slider, and captions and fullscreen controls for video. Sites with custom CSS targeting the former.td-media__progresselement should update to.td-media__controlsand.td-media__seek. - Quoted posts as
> [!SOCIAL]callouts. Quoted social posts use the> [!SOCIAL]Markdown callout form with a trailing block attribute line ({avatar="…" date="…" url="…" platform="…"}), keeping the quote readable as an ordinary blockquote in plain Markdown; see Social. If a site has legacysocialshortcode calls, convert them withpython3 bin/migrations/oink06.py migrate --site <dir> --only social --writefrom the theme repository, then runpython3 bin/migrations/oink06.py check --site <dir>to list any call it left unchanged.
Upgrade to 1.7.0
Sites already on 1.6.0 need no template or stylesheet migration. Review the
1.7.0 release notes and check these behavior and appearance
updates before pinning v1.7.0:
- Paper accent and preset typography. Paper moves to an ivory canvas (
#faf9f5) and a clay UI accent (#9b4a28, dark#de8460) while keeping blue underlined links in prose. To keep Paper’s previous blue accent, setparams.ui.theme_color: '#2b5f8c'. Terminal now sets screen prose in IBM Plex Mono (keeping IBM Plex Sans in print), and an explicitparams.ui.fonts.uiorfonts.bodyreaches the headings in every preset unlessfonts.headingnames its own face. See Brand and appearance. OINK 1.8.0 returns Paper to its 1.6.0 look and addspreset: news, which grew out of this 1.7.0 look and is the closest choice for a site that preferred it; see Upgrade to 1.8.0. - Updated single-key shortcuts. The shortcut map reorganized into twenty-nine bindings (10 navigation, 9 actions, 10 view): Zen Mode moves from
HtoZ(Hopens local browsing history), language cycling isX, preset cycling isT, color mode isY, blog index layout isL, version cycling isV, language home isG, command-only palette stays on\(withC), and[and]trigger ChatGPT and Claude.Gno longer opens the focused tree item (EnterandSpacestill do), and the home page’sNsection alias is gone (Jremains). Update any site-specific help copy or keyboard tests that mention pre-1.7 keys; see Keyboard shortcuts. - Typeset copy. Copying article prose now emits clean print-palette rich text by default so editors such as WeChat no longer keep page canvas backgrounds. Set
params.ui.rich_copy: false(or front matterrich_copy: false) if your site needs the browser’s default HTML copy. - New opt-in components and CSP. Timeline, Update, Social, and local Video/Audio work without external requests. If you enable
params.maporparams.video_embeds, allow your tile origin inimg-srcand enabled video hosts inframe-src; see Deploy. - Archived-version banner. Sites with
params.archived_version: truenow receive a styledrole="note"notice and require a non-emptyparams.version(omitting it warns once and drops the empty banner).
Upgrade to 1.6.0
Every site moving to 1.6.0 needs this section. The release keeps the
github.com/pgsty/oink module path but deliberately retires Sass,
Bootstrap’s JavaScript and Lunr, which is what lets Hugo 0.170 and newer
build the theme. Read the 1.6.0 release notes, then check
each item:
- Toolchain. Use a current Hugo release (tested on
0.170+; no Extended edition or Sass compiler needed). Removeextended: truefrom CI workflows once every branch you build uses OINK 1.6.0 or newer. - Stylesheets. Convert retired
assets/scss/_*_project*.scssfiles to plain CSS inassets/css/project.css, change hard-coded/scss/*.csspaths to/css/*.css, and switch custom-shell layouts topartial "css/bundle.html". See Retired SCSS hooks. - Bootstrap JavaScript. Remove dependencies on a theme-provided
window.bootstrapor ondata-bs-togglehooks, listen fortd:tab-showninstead ofshown.bs.tabon Landing download tabs, and change.dropdown-menuselectors on version lists to.td-version-menu__list. See Bootstrap’s JavaScript. - Local search. Remove site-script dependencies on
window.lunrand callOinkSearchEngine.create(documents, maxResults). Acontentindex over 2 MiB now moves page text intooffline-search-body.<lang>.json. See Local search without Lunr. - Markmap 1.1.0. Migrate the legacy Markmap 0.18 YAML keys to
foldLevel,wrapWidth,levelGap,siblingGapandcolorDepth; the old names warn and are ignored. See Markmap migration. - ReDoc 3.1.0. Each specification now renders in its own same-origin reader frame, so a Content Security Policy that restricts frames must allow
frame-src 'self'. ReDoc 2’shide-hostname,hide-logo,suppress-warnings,lazy-renderingandnative-scrollbarsdefaults are gone with its v2 API; if you override theredocshortcode or its styles, port those overrides to the ReDoc 3 API. Rename the specification extensionx-code-samplestox-codeSamples. Old links to operations still redirect, but ReDoc 2 deep links to schemas and to individual security schemes have no ReDoc 3 equivalent, so update any link that points at one. - Components that load on approach. Asciinema, ECharts, Infographic, Markmap and giscus now load as the reader nears them. If your own browser tests assert rendered charts, maps or players, scroll the component into view first.
Retired SCSS hooks
If your site has assets/scss/_variables_project.scss,
_variables_project_after_bs.scss or _styles_project.scss, convert them
by hand, once. The theme’s stylesheet is plain CSS and the build runs no Sass
compiler, so each of these files is ignored with one build warning, and until
you convert them the site builds with the theme’s default styles only.
- Move the rules in
_styles_project.scss, and in the partials it imports, toassets/css/project.cssas plain CSS. Native CSS nesting is fine. Write out what only Sass understands: variables, mixins such as Bootstrap’s breakpoints,@extend, and nested selectors that build a class name with&-. - For each Sass variable you assigned in the two variable hooks, set what it used to change. Colors and fonts have their own settings; see Brand and appearance. For anything else, override the custom property or the theme rule the variable fed.
- Build the site and compare the pages that matter.
project.cssloads after the theme’s stylesheet, so a theme rule of equal specificity no longer overrides your rule. Check elements that also carry a theme modifier class, and check each visual preset you offer. - Delete the three SCSS files and the partials only they imported. From then on, edit the project stylesheet.
If your own templates compiled the theme’s SCSS partials, ask for a theme stylesheet by name instead.
Bootstrap’s JavaScript
If your layouts, shortcodes or content use Bootstrap’s dropdowns, tabs,
modals or any other Bootstrap script, load Bootstrap yourself: the theme no
longer provides window.bootstrap or activates Bootstrap’s script hooks. To
find what depends on it, search for bootstrap., data-bs-toggle,
data-bs-dismiss, data-bs-target and .bs. event listeners. Replace each
with an OINK component, or load your own Bootstrap bundle in
layouts/_partials/hooks/body-end.html. The color-mode attributes
data-bs-theme and data-bs-theme-value still work.
On OINK Landing download tabs, listen for td:tab-shown instead of
shown.bs.tab; the event bubbles from the channel panel that just became
visible. The version lists in the footer and drawer use
.td-version-menu__list, so update custom .dropdown-menu selectors for
them. The version trigger reports its state through aria-expanded; observe
that attribute where a script listened for *.bs.dropdown.
Local search without Lunr
If your site uses local search, its configuration, index files and front matter keys are unchanged. After upgrading, check three things:
- The theme no longer ships Lunr. If your own layouts or scripts used
window.lunrfrom the theme’s copy, load Lunr yourself. - If you call
OinkSearchEngine.createdirectly, drop the Lunr argument:create(documents, maxResults). - Results rank differently. A short word no longer matches inside another
word, so
portno longer returns pages that only say “support”, and Chinese, Japanese and Korean queries no longer need spaces between words. Try the searches your readers use most.
A content index larger than 2 MiB is now published as two files: the index
keeps titles, headings and keywords, and offline-search-body.<lang>.json
holds the page text, which the palette loads after the first results. If you
set offline_search_index: summary only to stay within the size budget, you
can return to content. A script of your own that read body from a large
index must read the second file and join it by ref. An index within 2 MiB
is unchanged.
Fields are now search results: a query for a parameter name opens its entry
in a fields list or {.fields} table, with no change on your part. To keep
an established anchor, give the field an id. To make your own markup
searchable the same way, give the element an id and
data-td-search-entry="Title". The Shell contract
lists the rules.
Staying on 1.5.1 or older
If a site, or a branch you still build, stays on OINK 1.5.1 or older, its build compiles Sass and needs Hugo’s Extended edition, which ended with Hugo 0.169; those releases fail to build on Hugo 0.170. Everywhere that site builds, use the Extended edition at a release no newer than 0.169:
-
Locally,
hugo versionmust printextended. -
In GitHub Actions, give
peaceiris/actions-hugoan exact release and the Extended edition:the Install Hugo step of the workflow -
In the container image, install
hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.debinstead ofhugo_${HUGO_VERSION}_linux-${TARGETARCH}.deb, withHUGO_VERSIONno newer than 0.169. -
resources/_gen/also holds the CSS the build compiled, so clear it when a font or accent-color change does not show up.
Upgrade to 1.5.1
A site that leaves params.ui.compare unset needs no changes: 1.5.1 builds
exactly the same pages and outputs. The release stabilizes the opt-in
Duo view introduced in 1.5.0 and
fixes RSS, print, navigation, validation, search and accessibility behavior;
see the 1.5.1 release notes.
If you turn on params.ui.compare: true:
- Keep explicit
{#id}heading anchors aligned across translations, so Sync Scroll can match sections. - Set
languages.<lang>.params.ui.compare: falsefor any language that should neither show the reader nor appear as a target language. - Guard custom analytics in
head-end.htmlwithwindow.OinkComparePaneso pane loads are not counted twice. A local override of Hugo’sgoogle_analytics.htmlpartial is not used whilecompareis on; see Analytics and SEO. - Allow same-origin frames (
frame-src 'self') in your Content Security Policy, and make sure the server does not forbid same-origin framing withX-Frame-Options: DENYorframe-ancestors 'none'. - Open a translated Docs, Book or blog page and check that Open duo view (renamed from Open bilingual view in 1.5.1) loads the target language, syncs scrolling across shared headings, and switches cleanly on narrow screens.
Upgrade to 1.4.0 and 1.3.1
If your site uses PlantUML, 1.4.0 can render it in the browser with no extra
software or rendering service. To switch, keep params.plantuml: true or
plantuml.enable: true and remove svg_image_url; the two bundled browser
scripts take over. To stay in server mode, keep a non-empty endpoint, because
an empty endpoint now selects local mode. To turn rendering off, set
params.plantuml: false or plantuml.enable: false. Before switching an
existing diagram collection, review the
unsupported includes, libraries and CSP requirements.
Beyond that, 1.4.0 keeps the Hugo-only build and adds unified diagram
reading, richer local search, the opt-in table reader and the gallery blog
layout (1.4.0 release notes). After pinning it, review
navigation, image viewing and reader settings. If you install the theme as a
source copy, refresh the copied files as well; changing go.mod does not
update a vendored copy.
1.3.1 repaired Markmap text contrast and the fixed table of contents'
clearance above the footer, and added opt-in layouts for technical tables and
long FileTree comments. Existing content keeps its appearance; turn on
technical table layout or FileTree
wrap=true only where the full technical text has to show. A site that offers
all four styles keeps preset: paper with the explicit
[paper, slate, ink, terminal] menu. The 1.3.1 notes
describe these fixes and credit their contributor.
Upgrade to 1.2.0
If the site must keep its existing look, set params.ui.preset: slate
before adopting 1.2.0. preset_menu: true turns on reader choice and still
defaults to false. Ink and Terminal appear only when you name them as the
preset or in the menu list, and their buttons carry no experiment badge.
Review custom dark brand selectors as described in
Brand.
Apart from the appearance change, 1.2.0 needs no content migration. Check:
- The chosen preset, the light/dark icons, keyboard and mobile menus, saved preferences, and custom font and accent overrides. Sun means light and moon means dark, and switching styles must not change the saved light/dark preference.
- Explicit navigation, hidden subtrees, page links, Blog pagination canonicals, and SEO alternates for pages without translations.
- CJK search summaries that match only keywords, and outline links whose headings contain a literal percent sign. Compare the Edit, History and Create-child links for content on Windows or in mounts; mappings must yield repository-relative paths.
- Landing content with JavaScript disabled or blocked, preserved metric formatting, dialogs and keyboard shortcuts, the copy fallback, Draw.io controls, and numbered equations at narrow widths.
- Diagram endpoints and resource alt metadata in a production build: malformed values now warn and fall back safely. To disable rendering on purpose, use
params.plantuml: falseorparams.drawio.enable: false. - The revised PDF and migration tools, if you publish PDFs or convert content. Review PDF remote-resource opt-ins and migration diffs, including code examples nested in lists.
Upgrade to 1.1.0
If your site is on 1.0.x, no source migration is needed, and the module’s Go 1.27.0 directive is unchanged from 1.0.0; toolchain details are in the 1.1 release notes. What changed is behavior, so review the surfaces the site uses before choosing the new pin:
Languages- All 32 interface catalogs share one native-message schema. Check the site’s language labels, plural counts and RTL direction; authored translations remain the site’s responsibility.
Taxonomies- Root pages become term-card directories with a taxonomy switcher. Review taxonomy-template or CSS overrides, author portraits and localized breadcrumbs.
Sidebars- Cached trees keep each page’s effective settings and work without JavaScript. Test collapse, hover restore, the mobile drawer and keyboard focus; hidden content must leave the focus order.
Groupssidebar_divider: truekeeps a section’s children. Addbuild.render: neveronly if you mean to omit the group’s own outputs, then check child navigation, breadcrumbs, paging, Print and Book contents.Custom scripts- Feature-detect
OinkSidebarandOinkCommandPalette.registerSearchTailif an integration must also support 1.0.0. Restore branch state through the API rather than by changing classes or ARIA attributes.
params.ui.image_zoom and params.offline_search stay off by default, and
the new search hook enables no remote provider and adds no query telemetry.
params.ui.scroll_spy and the page-level scroll_spy are still accepted and
do nothing in 1.x, so removing an obsolete patch does not disable normal
outline tracking.
If the site keeps its own copies of theme code, such as an image-zoom script or a sidebar partial, compare them with the new implementation and update or remove them; otherwise the old copy keeps overriding the upstream fix. The details are in content groups, the sidebar contract, search actions and image zoom.
Upgrade from 0.4
If your site started on OINK 0.4 and a page gained or lost a feature after upgrading, check these changed defaults first:
-
Sequential paging is on.
docs,bookandblogpages end with previous / next links; documentation follows the sidebar tree and blog posts follow time. Setpager: falseon a page that stands outside any sequence. -
The navbar appears on every layout. Its compact state is one row of icon navigation with no second mobile accordion menu, so remove local scripts and tests that depend on the old mobile menu. To hide the navbar for a section, set
navbar_enabled: falsein a cascade. -
The footer defaults to
fatacross the site and accepts onlyfat,slimornone. Footer data lives indata/footer/<language>.yaml, ordata/footer.yamlon a single-language site; afooterkey left indata/homewarns and names the new location. -
Single-key navigation is on:
/opens full search and\opens command-only mode. Update training material that describes the old behavior. Page actions moved to a split button beside the breadcrumbs. -
The code block DOM changed: a
.td-codewrapper now encloses the original.highlight, and both.highlightand.chromaremain. In site CSS, replace a child selector such as.td-content > .highlightwith the descendant selector.td-content .highlight. -
The two ICP footer keys
footer_icpandfooter_icp_urlbecame one string that accepts inline Markdown:hugo.yml -
Mathematics needs Goldmark passthrough in the site’s own configuration, because Hugo does not merge a theme’s
markupsettings. If the site uses\(…\),\[…\]or$$…$$, enable passthrough in itshugo.yml; see Math.
Every key above is documented in Configuration and Layouts and page types. Convert the 0.4 shortcodes with the migration toolkit below.
The content migration toolkit
If your content still uses 0.4 shortcodes such as alert, tabpane or
imgproc, convert them with oink06.py instead of editing hundreds of files
by hand. It ships in the theme repository and needs only the Python standard
library:
- A dry run is the default and only
--writechanges files, so run it, read the diff, then write. - A second run must change nothing. If a second
--writestill reports changes, a transformation has not converged; stop and inspect those files. - Text inside code fences is left alone, so documentation that shows the old syntax stays intact.
- A construct the tool cannot express is left unchanged and reported with
file:lineand a reason, as a list for manual work rather than a failure.
To convert one class at a time, pass --only with keys from the last column
of the syntax map:
Afterwards, rebuild, read the warnings and look at the rendered pages. The tool guarantees valid syntax; whether each page still says what you meant is yours to check.
The 0.4 → current syntax map
Each page under Components describes the new form and its parameters.
Migrating from Docsy
If your site runs on Docsy, most of it carries over. OINK is a hard fork of
Docsy and keeps its content model, td- naming and most front matter, so the
migration is mainly deleting the site’s copies of the shared shell and letting
the theme supply it. The prose stays as it is.
-
Pin the target version. Point
go.modat an OINK release tag, or use a complete versioned archive. While you evaluate, an uncommittedgo.workcan point at a local checkout. -
Inventory the overrides. Sort every site-level file under
layouts/,assets/andstatic/into four groups: copies of the shared shell (delete once verified), components OINK already provides (delete or rename mechanically), brand customization (keep, in the smallest suitable hook), and business-specific data and interaction (keep in the site). Delete in reference order rather than emptyinglayouts/at once, because the home or download page may still call a partial you plan to remove. -
Move the configuration.
title,languages.*,github_repo,github_branch,page_widthandparams.ui.*keep their meaning and position; OINK adds no namespace of its own. Turn on search and the logo with these keys:hugo.ymlRename Docsy’s camelCase search keys yourself:
offlineSearch,offlineSearchIndex,offlineSearchMaxResults,offlineSearchOnServeandofflineSearchSummaryLengthall become their underscored forms. OINK ignores the old names without a warning, so search stays off silently until you rename them. -
Fonts and styles. Docsy’s SCSS hooks in
assets/scss/are no longer compiled, so its Sass variables, including the font variables and the Google Fonts switches, have no effect. Convert the hooks as described in Retired SCSS hooks. OINK bundles IBM Plex Sans, Inter, Chakra Petch and IBM Plex Mono, and no preset requests Google Fonts. To change fonts, use the token layer; see Brand and appearance. -
Convert the shortcodes. Docsy’s
alert,pageinfo,tabpaneandcardfamilies all have a current counterpart; convert them in bulk with the migration toolkit, one--onlyclass at a time. -
Delete one group at a time and build after each. Rehearse on a scratch copy first, recording the theme commit, Hugo version, removed files and generated HTML file count; once the result is equivalent, repeat the steps on the production branch.
The “delete once verified” group in step two is usually:
layouts/baseof.htmland the shared docs and blogbaseof*.html;- the navbar, footer, sidebar, TOC, search and head CSS partials and their hooks;
- the old brand documentation shell partials;
- copies of the
asciinema,echarts,infographic,doc-carousel,details,tab/tabpane, card andparamshortcodes; - the JavaScript, Lunr copy, carousel code and SCSS that served only those implementations;
- PostCSS and Autoprefixer steps that no site asset needs any more.
Two problems tend to surface after the deletions.
A site script reports $ is not defined. Docsy loaded jQuery in every page’s
<head>; OINK does not need it and does not bundle it. If your site still
needs it, load it from the site:
A home page built from Docsy’s blocks/* fails with
template for shortcode "blocks/cover" not found, because OINK has no such
shortcode family. Build the home page from sections in
data/home/<language>.yaml, or set layout: landing on the page; see
Home and landing pages.
Related
- Deploy — rolling back a deployment
- Troubleshooting — reading a build error after an upgrade
- Local preview — clearing caches and previewing against a theme checkout
- From scratch and other install methods — choosing between the four install methods
- Components — each component’s current form