Install Oink
Oink is published as the Hugo Module github.com/pgsty/oink. A consuming site
builds with Hugo Extended alone; Node.js, npm, PostCSS, and CDN-hosted browser
packages are not part of the build contract.
Prerequisites
Install Git, Go, and Hugo Extended 0.160.1 or newer. The project site
currently validates with 0.164.0:
The Hugo version output must include extended.
Add the module
From your Hugo site root, initialize a module if the site does not already have one, then pin an Oink release:
Replace THEME_REF with a published tag such as v0.2.0 or an immutable
commit. Add the import to hugo.yaml:
Commit the resulting go.mod and go.sum. Do not run production builds against
an unpinned branch.
Preview the site
Start an editing server:
Create a production artifact with:
Oink ships Bootstrap, Font Awesome, fonts, search, diagrams, API documentation
runtimes, and its content components. A consuming site does not need a
node_modules directory.
Develop against a local checkout
Clone the theme and site as siblings, then use a local Go workspace:
Keep go.work out of version control. The committed go.mod remains pinned to
the public module; the workspace substitutes the sibling checkout only on your
machine.
Add bilingual content
Create the English page first:
Then add its translation beside it:
Keep front matter identifiers, code, commands, parameter names, and link targets semantically aligned. Translate reader-facing prose. For stable cross-language deep links, preserve the English heading ID explicitly in the Chinese heading:
Configure the minimum site
The essential configuration is small:
Add menus, outputs, markup extensions, repository links, and optional features as the site grows. See Configuration for the supported model.
Validate before publishing
At minimum:
- build from a clean checkout with the committed module files;
- run
hugo --gc --minifywith the pinned Hugo Extended version; - browse representative English and Chinese pages;
- verify language switching, search, mobile navigation, dark mode, and print;
- inspect browser network requests if the site promises offline operation.
These checks establish a build artifact. Publishing that artifact and verifying the hosted URL are separate deployment steps.