Quick start
This path does not start from an empty directory. It starts by cloning the site you are reading, deleting what you do not need, and replacing the rest with your own details. This site is OINK’s regression site: it contains every component and every page type, and it tracks the theme version. Trimming it down is less writing than adding configuration and examples one at a time to an empty directory.
Prerequisites: a machine that can install Hugo Extended and Go, a GitHub account, and ten minutes. No Node.js and no other front-end toolchain.
What you end up with
A bilingual documentation site: your directory tree in the left sidebar, this page’s outline on the right, full-text search and a command palette in the navbar, and light or dark following the system. One Markdown source produces the web page, the print page, plain Markdown and RSS. Hosted on GitHub Pages.

Walkthrough
-
Install Hugo Extended and Go
Besides Git you need two things. Hugo Extended must be
0.160.1or newer: the standard Hugo build has no embedded Sass compiler, cannot compile the theme’s styles, and fails the build. Go resolves modules: OINK is published as a Hugo Module, and Hugo uses Go’s module machinery to download and verifygithub.com/pgsty/oink.macOSLinuxWindowsCheck once afterwards; the output must contain
extended:On other platforms follow the Hugo installation guide and go.dev/dl, taking care to pick the extended build.
-
Clone the documentation site and preview it
Open http://localhost:1313/; the Chinese site is at http://localhost:1313/zh/. The first start downloads the theme module (a few seconds to a minute, depending on the network); after that, edits hot-reload in milliseconds.
The committed
go.modpins the theme version, so the clone builds as it is, with no extra install script.NoteThe
Makefilein the repository is only a set of command aliases.make devandmake checkuse a sibling../oinktheme checkout throughHUGO_MODULE_REPLACEMENTS;make buildandmake servealways use the published version pinned ingo.mod. For a new site,hugo serveris enough. -
Replace the site details
Site identity lives entirely in
hugo.yml.baseURLis a YAML anchor — the real address is written onparams.productionURL, and that is the only place to change it:hugo.ymllanguages.en.titleandlanguages.zh.titleoverride the top-leveltitle, so change both. Every parameter’s meaning and default is in Configuration.Delete the configuration specific to this site. Keeping it points your site at OINK’s repositories and accounts.
Key in hugo.ymlWhat to do services.googleAnalytics.idOINK’s analytics ID. Delete it, or replace it with your own when you want analytics params.commentsgiscus pointing at discussions in pgsty/oink.pgsty.com. Delete the block or point it at your repositoryparams.tdVersionparams.versionparams.version_menuparams.versionsOINK’s version menu. Delete params.github_project_repoA link to the theme repository. Delete languages.<lang>.menus.mainNavbar entries pointing at this site’s sections such as /docs/tutorial. Rewrite for your treeReplace the logo and icons. Replace these three files, keeping the filenames — the theme mounts them by name:
static/static/logo.svgis this site’s own brand lockup and no parameter points at it. Delete it, or replace it with a horizontal wordmark and setparams.wordmark.Replace the content.
content/docs/is OINK’s own theme documentation; delete the whole tree and write your first page:content/docs/_index.mdcontent/blog/can keep one post as a template or be deleted entirely (if you delete it, remove theblogentry frommenus.mainas well). Which directories must stay and which belong to the documentation site itself is in Repository tour.For an English-only site, delete the whole
languages.zhblock and every.zh.mdfile, leaving one language:hugo.ymlTo keep both languages or swap in a different pair, see Languages.
-
Deploy
Create an empty repository on GitHub and replace the local history with your own:
The repository ships with
.github/workflows/pages.yml: a push tomainbuilds and publishes, and it can also be triggered by hand from the Actions page (workflow_dispatch). It pins the Hugo Extended and Go versions, builds with--printPathWarnings --panicOnWarning, and takesbaseURLfrom GitHub Pages, so publishing to a subpath such asexample.github.io/product-docs/needs no configuration change.In the repository, go to Settings → Pages → Build and deployment → Source and choose GitHub Actions. The default is
Deploy from a branch, and leaving it will make the workflow fail at the deploy step.Deletingscripts/means editing the workflowThe
Verify advertised and pinned release matchstep inpages.ymlrunsnode scripts/check-release-pin.mjsto check that the version the site advertises matches the one pinned ingo.mod. Oncescripts/is gone, remove that step andSet up Node.jsfrompages.yml.For Cloudflare Pages, Netlify, Nginx and offline packaging, see Deploy: the build command is always
hugo --gc --minify, and onlybaseURLand the environment variables differ.
Verify
Run a production build locally. It is stricter than the development server, and path warnings fail the build:
It passes when it prints Total in … with no WARN or ERROR. Then check
against the preview:
- The navbar shows your site name and logo, and the browser tab shows your favicon
- The sidebar is your own tree, and every page opens
- Ctrl with K (or ⌘ with K on macOS) opens the command palette and finds the page you just wrote
- In the menu beside the page title, “Edit this page” points at your repository, not
pgsty/oink.pgsty.com - After deploying,
Deploy Oink site to GitHub Pagesis green on the repository’s Actions page
For build errors, see Troubleshooting.
Next steps
- Repository tour — what each cloned directory is, and what can go.
- Writing pages — what a documentation page is made of: front matter, heading anchors, links and images.
- Components — callouts, tabs, field lists, file trees and the rest, one page each.
- Brand and appearance — accent colour, font preset, page width and custom styles.
- Deploy — hosting beyond GitHub Pages, and the acceptance checklist.
Instructions for a coding assistant
The four steps above can be handed to a coding assistant (Claude Code, Codex and the like). Copy the block below and replace the three bracketed items with your own details:
Instructions to copy wholesale
The resulting site is easy for an assistant to read: every page has a .md
plain-text output, the site root has llms.txt, and the menu beside the page
title offers “Copy as Markdown” and “Open in Claude”. See
AI-agent support.
To start from an empty directory instead of this repository, see From scratch and other install methods.
Related
- Repository tour — what each directory is, and the order to delete in
- From scratch and other install methods — starting with
hugo mod init, submodules and offline installation - Local preview — the
hugo serverswitches worth knowing, and previewing drafts - Deploy — configuration per host, and the acceptance checklist
- Troubleshooting — the four common classes of error: build, language, search, platform