Upgrade
Upgrading OINK is changing one pinned module version and confirming the site still builds warning-free. Most content needs no change; where it does — 0.4 shortcodes becoming the current native Markdown forms — a dry-run-first migration tool does it, so hundreds of files need not be edited by hand.
An upgrade changes rendered output. Create an upgrade branch before starting, and the cost of backing out is discarding a branch.
Read the release notes first
Every version’s changes, breaking changes and upgrade notes are in its release notes; read the target version’s before upgrading:
- The release series in this site’s project blog
- The Releases page on GitHub
The notes say whether content has to change, whether a configuration key was removed, and whether a default behaviour moved. Skipping this step means guessing afterwards why a page looks different.
Upgrading the Hugo Module
A production site pins a published release tag or a deliberately selected
immutable commit, follows no branch, and does not use @latest. The example
below upgrades to the published v1.2.0 tag. For a later release, verify its
publication and module resolution before selecting that tag:
When selecting a tag, confirm that the module graph shows that exact version.
A deliberately selected immutable commit is normally recorded as a Go
pseudo-version; that is valid if it resolves to the intended commit, but it is
not evidence of a named release. Commit the resulting go.mod and go.sum.
For the published tag in this example, go.mod contains:
make dev and make check set HUGO_MODULE_REPLACEMENTS for that command
only, using the sibling theme checkout. To judge whether a release tag works,
remove that environment replacement and disable both GOWORK and
HUGO_MODULE_WORKSPACE. Inspect persistent replacements and _vendor/ too;
make build by itself does not prove which theme was resolved. See the
preview guide.
For a Git submodule, check that it has no local edits, fetch the tags, and check out the exact published version rather than following its remote branch:
Commit the updated submodule pointer after validation. For an offline archive
or clone, replace themes/oink/ with the selected version’s complete tree and
confirm that theme: still matches the directory name. The install-method
tradeoffs are in
From scratch and other install methods.
What to do after upgrading
That does three things at once: clears possibly stale caches, rebuilds with the new version, and turns any warning into a failure.
--logLevel info includes informational diagnostics, while
--panicOnWarning treats warnings as failures. Review the deprecation messages
emitted by the pinned Hugo version before upgrading it; the severity and
removal schedule depend on the deprecated feature.
Once the build passes, look with your own eyes: the home page, a documentation page, a blog page, the 404, both languages, both colour schemes, the print view, and anywhere the site customized something.
Upgrading from 1.0 to 1.1
This checklist covers the published v1.1.0 release. Each consumer still needs to update its dependency pin, rebuild and deploy; theme publication does not upgrade an existing site automatically.
No source migration is required from 1.0.0. Hugo Extended 0.160.1 remains the
floor; CI uses the pinned 0.165.0 toolchain. The module’s Go 1.27.0 directive is
unchanged from 1.0.0. On Hugo 0.160.x, a non-default generic zh language
alongside the regional Chinese catalogs needs locale: zh-CN.
Review the affected surfaces before choosing the new pin:
Languages- All 32 interface catalogs have the same 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 any taxonomy-template or CSS overrides, author portraits, and localized breadcrumbs.
Sidebars- Cached trees preserve effective page settings and remain usable without JavaScript. Exercise collapse, hover restore, mobile drawer, and keyboard focus; hidden content must leave the focus order.
Groupssidebar_divider: trueretains a section’s children. Addbuild.render: neveronly when that group’s own outputs are intentionally omitted; verify 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 changing classes or ARIA attributes directly.
params.ui.image_zoom and params.offline_search remain off by default. The
new search hook does not enable a remote provider or add query telemetry.
params.ui.scroll_spy and page-level scroll_spy remain accepted no-ops in
1.x; removing the obsolete patch does not disable normal outline tracking.
Update or remove affected site-level copies of theme code after comparing them with the new implementation. A copied old image-zoom script or sidebar partial will otherwise continue to hide the upstream fix.
To test local theme changes with the documentation site, use its sibling theme checkout without committing a filesystem replacement:
These commands validate the local checkout. For release acceptance, pin the published version, build without a module replacement, then validate the deployed pages. The authoring and API details live in content groups, the sidebar contract, search actions, and image zoom.
Upgrading from 1.1 to 1.2
Paper is the default in OINK 1.2.0. Set params.ui.preset: slate before
adopting this change if the site must retain its existing appearance.
preset_menu: true enables reader choice; its default remains false.
Ink and Terminal require an explicit preset or menu list. Their buttons do
not carry experiment badges; the configuration opt-in remains unchanged.
Review custom dark brand selectors as described in Brand.
OINK 1.2.0 is available as a published tag. Apart from the default appearance change above, no content migration is required. Hugo Extended 0.160.1 remains the compatibility floor. Update the module, then verify the site:
- Check the chosen preset, light/dark icons, keyboard and mobile menus, saved preferences, and custom font/accent overrides. Sun means light; moon means dark. Switching styles must not change the saved light/dark preference.
- Recheck explicit navigation, hidden subtrees, page links, Blog pagination canonicals, and SEO alternates for pages without translations.
- Check CJK keyword-only search summaries and outline links with literal percent signs. Compare source-derived Edit, History, and Create child links on Windows or mounted content; mappings must yield repository-relative paths.
- Check Landing content with JavaScript disabled or blocked, preserved metric formatting, dialogs and keyboard shortcuts, copy fallback, Draw.io controls, and numbered equations at narrow widths.
- Run a warning-fatal build for diagram endpoints and resource alt metadata;
malformed values now produce a warning and use a safe fallback. To disable
a PlantUML or Draw.io endpoint intentionally, use
falseor an empty string. - Use the revised PDF and migration tools when testing publication or content conversion. Review PDF remote-resource opt-ins and migration diffs, including code examples nested in lists. The consumer-upgrade helper ships with 1.2.0 for inventory, module updates and exact-version validation.
The Architecture, Components, Shell, and Migration contracts describe the published 1.2.0 behavior.
The content migration toolkit
A batch of 0.4 shortcodes became the current native Markdown forms. The theme repository ships a tool for that, depending only on the Python standard library:
Four things to remember while using it:
- A dry run is the default, and only
--writetouches disk. Dry-run, read the diff, then write. - A second run should change nothing. A second
--writestill reporting changes means a transformation is not converging; stop and look at those files. - Text inside fences is untouched, so a documentation site demonstrating the old syntax is not damaged.
- A construct it cannot express is left as it stands and listed with
file:lineand a reason, as a manual work list rather than a failure.
To convert one class first, use --only with the keys in the table’s last
column:
Rebuild afterwards (with --panicOnWarning) and look at the rendered pages: the
tool guarantees correct syntax, not that the meaning is what you intended.
The 0.4 → current syntax map
What each new form looks like and what parameters it takes is on its page under Components.
Migrating from Docsy
OINK is a hard fork of Docsy: the content model, the td- naming, the Sass
variables and most front matter are still there. The core of a migration is
deleting the copies of the shared shell in the site and letting the theme’s
implementation take over — not rewriting the prose.
-
Pin the target version. Change
go.modto an OINK release tag, or use a complete versioned archive. During evaluation, an uncommittedgo.workcan point at a local checkout. -
Inventory the overrides. Sort every site-level file under
layouts/,assets/andstatic/into four classes: copies of the shared shell (delete after verifying), components OINK already provides (delete or rename mechanically), brand customization (keep, reduced to the smallest hook), and business-specific data and interaction (stays in the site). Delete by reference order, and do not emptylayouts/at once: the home page and download page may still call a partial you are removing. -
Move the configuration.
title,languages.*,github_repo,github_branch,page_widthandparams.ui.*all stay in their existing semantic positions; OINK opens no namespace of its own. Search and the logo are just keys to turn on:hugo.ymlDocsy’s camelCase search keys have been renamed in OINK:
offlineSearch,offlineSearchIndex,offlineSearchMaxResults,offlineSearchOnServeandofflineSearchSummaryLengthall become their underscored forms. Rename them deliberately — the migration registry that used to stop the build and name the replacement has been removed, so an old key is now simply a key nobody reads, and search stays off with no message at all. -
Fonts and styling compatibility. The Docsy Sass variables in the site’s
assets/scss/_variables_project.scssstill work as the seed values for the font roles, and need not be deleted to upgrade:$td-fonts-serif,$font-family-sans-serif,$headings-font-familyand$font-family-codeeach feed their role. Docsy’s Google Fonts switches$td-enable-google-fonts,$td-google-font-nameand$td-web-font-pathare no longer read by the theme; leaving them breaks nothing and does nothing, because OINK ships Inter, Chakra Petch and IBM Plex Mono and neither preset requests anything from Google Fonts. To change fonts, go through 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 above, one--onlyclass at a time. -
Delete one group at a time, building after each. Rehearse on a scratch copy, recording the theme commit, the Hugo version, which files were removed and how many HTML files came out; only after confirming equivalence, repeat it on the production branch.
The “delete after verifying” class in step two is usually these files:
layouts/baseof.htmland the shared docs / 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 no site asset needs any more.
Two kinds of problem surface after the deleting.
A site’s own script reports $ is not defined: the theme does not bundle
jQuery, which Docsy used to load in every page’s <head>. Nothing in the theme
needs it, and a site that still does loads it itself:
A home page built from Docsy’s blocks/* fails an OINK build with
template for shortcode "blocks/cover" not found: the theme has no such
shortcode family. Switch to home page sections in
data/home/<language>.yaml, or give the page layout: landing — see
Home and landing pages.
Upgrading from 0.4
0.4 changed several defaults. If the page gained or lost something after the upgrade, check these first:
-
Sequential paging is on by default.
docs,bookandblogpages all have previous / next at the page end; documentation follows the sidebar tree and the blog follows time. A page deliberately outside any sequence opts out withpager: false. -
The navbar shows on every layout. Its compact state is one row of icon navigation, with no second mobile accordion menu, so local scripts and tests that depend on the old mobile menu have to go. A whole section without a navbar uses
navbar_enabled: falsein a cascade. -
The footer defaults to
fatsite-wide. Onlyfat/slim/noneare accepted, and footer data must live indata/footer/<language>.yaml(ordata/footer.yamlon a single-language site); a leftoverfooterkey indata/homewarns with the new location, and strict publishing rejects it. -
Single-key navigation is on by default:
/opens full search and\command-only mode. Training material describing the old behaviour needs updating. Page actions have also moved to a split button beside the breadcrumbs. -
The code block DOM changed. A
.td-codewrapper now encloses the original.highlight(both.highlightand.chromaare kept), so a direct child selector such as.td-content > .highlightin site CSS becomes the descendant selector.td-content .highlight. -
Two ICP footer parameters were removed:
footer_icpandfooter_icp_urlbecame one string accepting inline Markdown.hugo.yml -
Mathematics needs the site to enable passthrough. Hugo does not merge a theme’s
markupconfiguration, so a site using\(…\),\[…\]or$$…$$must enable the Goldmark passthrough extension in its ownhugo.yml— see Math.
The complete configuration for all of these is in Configuration and Layouts and page types.
Verify
An upgrade is not finished at “the build passed”. Look at each surface:
This site’s full gate is:
Another site runs the equivalent build, link, output and browser checks; the details are in Troubleshooting.
A validated source commit, a published tag that resolves through the module proxy, a consumer pin with its checksum, and a verified production deployment are separate states. One green local build does not prove the others.
The last step happens in the real environment: deploy a preview, verify the pages and the browser’s network requests on the real URL, merge once reviewed, and smoke-test production afterwards.
Rollback
What rolls back is the version pin, not the working tree:
Three principles:
- Keep the pre-upgrade module pin, the site commit and the known-good deployment artifact, and restore all three together.
- Do not roll back only part of it. Putting a few old layout copies back on top of a new theme produces a hybrid harder to diagnose than either complete version.
- Keep the upgrade branch and its acceptance evidence. A rollback restores production first; it does not throw away the work already done.
Rolling back the deployed output itself (republishing the previous deployment) is in Deploy.
Related
- Deploy — rolling back deployed output
- Troubleshooting — reading a build error after an upgrade
- Local preview — clearing caches and the
go.workworkspace - From scratch and other install methods — weighing the four install methods
- Components — each component’s current form