This is the multi-page printable view of this section. .
Upgrade
- 1: Upgrade the Oink Hugo Module
- 2: Upgrade an Oink Git submodule or clone
- 3: Migrate from the Docsy npm package
- 4: Migrate an existing Docsy site
These pages describe the OINK update contract. A target release is the version that you are moving the site to. Read its release note before starting: it records breaking changes, required actions, and the validated Hugo range.
OINK consumer builds do not install Node.js packages. npm remains repository tooling for theme maintainers, not a site-update step.
Before you update
- Work from a Git branch or another recoverable copy of the site.
- Record the currently pinned theme revision and Hugo Extended version.
- Build the current production site once so that new failures can be separated from pre-existing ones.
- Read every release note between the current and target versions; do not skip intermediate migration actions.
Order of steps
Perform the update in this order:
- Update Hugo if the target release changes its supported range.
- Update the theme using the site’s installation mode.
- Review theme overrides.
- Check the site in development and production builds.
Update Hugo
Install a Hugo Extended version supported by the target release. Update the same version in local developer setup, CI, Cloudflare Pages, Netlify, container images, and any cache keys. Verify the selected binary before building:
hugo versionThe current validation baseline is Hugo Extended 0.164.0; the theme’s current
minimum is 0.160.1. A release note takes precedence if it changes either
value.
Update the theme
Use the page matching the site’s installation mode:
For a released archive, replace the existing theme directory with the target
archive only after preserving site-owned overrides. Verify its checksum and keep
LICENSE, NOTICE, and VENDOR.json with the distribution.
Review theme overrides
If the site overrides theme files, compare each override with its new theme counterpart and port relevant changes. Check these directories:
assets/i18n/layouts/static/
Remove an override when the theme now provides the same behavior. Keep site business components, product pages, and brand assets at the site layer.
Check your site
Run both a development preview and the exact production command. For the Hugo-only contract, the production build is:
hugo --gc --minifyVerify at least the following:
- The build completes without errors, warnings, or deprecation notices.
- English and Chinese home, documentation, ordinary blog, and release-note pages render.
- Navigation, breadcrumbs, table of contents, stable heading links, and language switching resolve correctly.
- Local search returns results in both languages.
- Dark and light modes, mobile navigation, and print output remain usable.
- Pages load only the local runtimes they use; default pages make no theme-owned third-party subresource requests.
- Mermaid, KaTeX, Markmap, Swagger UI, Redoc, and any used content components still render.
- Site-owned shortcodes and business pages remain intact.
Finally, run every release-specific check from the target release note.
1 - Upgrade the Oink Hugo Module
Pin a version
Production sites should import a release tag or immutable commit, never an unversioned branch. From the site root, update Oink to a specific ref:
hugo mod get github.com/pgsty/oink@THEME_REF
hugo mod tidyReplace THEME_REF with the published root tag or commit named by the release.
Test a local checkout
To test the current OINK checkout without changing the committed module path, use an ignored Go workspace with the local theme checkout:
go work init .
go work edit -replace=github.com/pgsty/oink=/absolute/path/to/oink
export HUGO_MODULE_WORKSPACE=go.work
hugo --gc --minifyKeep go.work out of version control rather than committing a
developer-specific absolute path.
Verify the resolved module
Inspect Hugo’s dependency graph:
hugo mod graphConfirm that the theme resolves to the intended tag, commit, or local
replacement. No hugo mod npm pack or npm install step is required for OINK:
browser dependencies already ship with the theme.
Continue with Review theme overrides.
2 - Upgrade an Oink Git submodule or clone
Use the procedure matching the installation: submodule or clone. Pin the target release tag or immutable commit in both cases.
Update the submodule
From the site root, fetch tags inside the theme and check out the target ref:
git -C themes/oink fetch --tags
git -C themes/oink checkout THEME_REF
git add themes/oink
git commit -m "Update OINK theme to THEME_REF"Replace themes/oink if the site uses another directory name. The parent
repository records the resulting submodule commit. Push that parent commit so CI
and other contributors resolve the same source.
No npm installation is required. If the complete theme has nested source-only submodules for a particular release, initialize them according to that release’s notes; browser runtime assets in the OINK distribution are already present.
Update the clone
If the theme directory is a clone tracked or restored by the site, update it to the target ref:
git -C themes/oink fetch --tags
git -C themes/oink checkout THEME_REFCommit, archive, or record the updated theme using the same reproducible method
the site already uses. Do not leave production builds following main.
If the clone contains local changes, commit them on a branch before switching refs. Rebase or reapply them after the update and resolve conflicts explicitly. Prefer moving reusable changes upstream into OINK and keeping only true site-specific overrides in the consuming site.
Continue with Review theme overrides.
3 - Migrate from the Docsy npm package
The upstream @docsy/theme npm package is not an OINK distribution channel.
OINK ships Bootstrap, Font Awesome, fonts, and browser runtimes directly with
the theme so that consumer sites build with Hugo Extended alone.
Remove the npm theme integration
First select an OINK distribution: a versioned archive, Git submodule or clone,
or the compatibility Hugo module. Make that theme available to Hugo and confirm
that hugo --gc --minify can resolve it.
Then remove @docsy/theme and any dependencies used only to build Docsy assets
from the site’s package.json. Remove npm mounts for Bootstrap and Font Awesome
from Hugo configuration, along with PostCSS and Autoprefixer build steps that
exist only for the old theme pipeline.
Do not delete application dependencies merely because they use npm. The Hugo-only contract covers the documentation theme; a site-owned application or business component may have a separate, intentional toolchain.
Verify the migration
Build from a clean checkout with Hugo Extended and no node_modules directory:
hugo --gc --minifyCheck LTR and RTL pages if the site supports both. Verify local fonts and icons, search, diagrams, API documentation, and any migrated content components. Once the build is clean, remove obsolete lockfiles only if no site-owned tooling uses them.
Continue with Review theme overrides.
4 - Migrate an existing Docsy site
OINK is intended to replace copied common shells, runtimes, and shortcodes without forcing a bulk rewrite of ordinary content. A safe migration removes overrides by dependency, keeps product-specific behavior in the site, and validates a temporary copy before changing production.
Migration principles
- Pin the target implementation; do not migrate production to an unversioned branch.
- Inventory overrides before deleting them.
- Remove common theme copies, not the site’s business logic.
- Preserve content URLs, front matter, and shortcode behavior where the OINK API is compatible.
- Make unsafe or online exceptions explicit and temporary.
- Test build output, browser behavior, and hosted behavior as separate layers.
Pin the target
Pin a published tag in go.mod or use the complete versioned archive. During
pre-release evaluation, a Hugo Module site can use an ignored Go workspace to
resolve a local checkout without editing the committed module version:
go work init .
go work edit -replace=github.com/pgsty/oink=/absolute/path/to/oink
export HUGO_MODULE_WORKSPACE=go.work
hugo --gc --minifyThe site’s hugo.yaml imports github.com/pgsty/oink; the workspace
substitutes only the local checkout.
Inventory existing overrides
Group each site-level file into one of four classes:
| Class | Action |
|---|---|
| Exact or near-exact copy of common shell | Remove after OINK validation |
| Reusable component now supplied by OINK | Remove or mechanically rename |
| Narrow brand or product customization | Keep, then reduce to the smallest hook |
| Business-specific data or interaction | Keep in the site |
Search layouts/, assets/, static/, configuration, and build workflows
together. A copied shortcode often has a matching JavaScript bundle, stylesheet,
vendor file, and CI install step.
Move configuration
Search and brand
Enable theme-owned local search and point the shell at the site’s own logo:
params:
logo: img/product.svg
offlineSearch: trueContinue using title, languages.*, github_repo, github_project_repo,
github_branch, page_width, and ui.* in their existing semantic locations.
Do not migrate values into an oink.* namespace.
Fonts
The legacy Sass switch $td-enable-google-fonts: true now selects the local
Open Sans files shipped by OINK; it no longer requests Google Fonts.
$td-web-font-path is not part of the current build. A site that needs another
font must provide approved local assets and their licenses.
Remove common overrides
After a temporary build proves equivalence, remove site copies of:
layouts/baseof.htmland common docs/blogbaseof*.htmlfiles;- common navbar, footer, sidebar, table-of-contents, search, head-CSS partials, and their hooks;
- old common branded documentation-shell partials;
asciinema,echarts,infographic,doc-carousel,details,tab/tabpane, card, andparamshortcode copies;- JavaScript, Lunr copies, carousel code, and SCSS used only by those removed implementations;
- consumer PostCSS and Autoprefixer steps that no remaining site asset needs.
Delete by reference, not with a blanket removal of layouts/. Home pages,
download pages, and portals may still call local partials such as icons, search
dialogs, blog rows, or tag filters.
Keep site-specific behavior
Keep content and code whose semantics belong to the product:
- product matrices and compatibility data;
- pricing, downloads, portals, solutions, and catalog pages;
- site-specific home-page composition;
- custom redirects, headers, analytics, or identity integrations;
- content components that encode business data rather than reusable presentation.
For the Pigsty family, pgvers, pgext_matrix, pgext_os_matrix, home-docs,
and the current metric implementation remain at the site layer.
Reference-site matrix
The current migration plan uses these boundaries:
| Site | Remove or migrate | Keep |
|---|---|---|
| SILO | Common docs/blog shell, core shortcodes, duplicate runtimes; set logo: img/silo.svg |
Home page, download page, product data |
| PGSTY | Common shell and core shortcodes; set logo: img/logo/logo.svg |
Portal, solution, and enterprise pages |
| SOW | Common docs/blog shell, core shortcodes, duplicate runtimes; set logo: img/sow.svg |
Home page and repository-specific content |
| Pigsty | Common shell, core shortcodes, duplicate runtimes; set logo: icons/logo.svg and retain reviewed ECharts callbacks |
Extension matrices, home/pricing pages, catalog styles |
The matrix is a starting inventory, not permission to delete every similarly named file. Resolve actual template references in the target checkout.
Rehearsal workflow
Rehearse each migration in a disposable copy of the consuming site. Apply the local Oink workspace, remove one planned override group, block unintended network and frontend-tool access, and run the production build:
HUGO_MODULE_WORKSPACE=go.work hugo --gc --minifyDo not modify the source workspace during a rehearsal. Retain failed copies for diagnosis and record the exact theme commit, Hugo version, removed files, and output counts.
Current evidence
The latest recorded rehearsal on 2026-08-08 used Hugo Extended 0.164.0:
| Site | Rehearsal result | HTML files |
|---|---|---|
| SILO | Removed 20 common overrides; built complete English and Chinese content with OINK shell, same-origin search, and site logo | 1,095 |
| PGSTY | Removed 20 common overrides; built the bilingual portal and a temporary docs page for shell validation | 16 |
| SOW | Removed 20 common overrides; built complete English and Chinese content with OINK shell, same-origin search, and site logo | 128 |
| Pigsty | Removed 24 common overrides; kept three business matrix shortcodes and existing ECharts callbacks | 2,473 |
These are temporary-copy build results, not proof that the four production sites have been migrated or deployed.
Production rollout
For each site:
- create a dedicated migration branch;
- pin the OINK candidate and record its source commit;
- remove one coherent override group at a time;
- run a clean Hugo-only build and focused automated tests;
- compare representative home, docs, blog, special, and
404pages; - check mobile navigation, both color modes, language switching, search, print, and the site’s retained business components;
- deploy a preview and verify its real URLs and requests;
- merge and deploy only after review, then perform production smoke tests.
Record deliberate differences instead of forcing pixel equality where OINK intentionally changes the shell.
Rollback
Keep the pre-migration theme pin, site commit, and known-good deployment artifact. A rollback should restore all three consistently. Reintroducing a random subset of copied layouts against the new theme creates a hybrid state that is harder to diagnose than either complete version.