Skip to content

This is the multi-page printable view of this section.

Return to the regular view of this page

Operations

Take a finished site from your machine to a live address and keep it running there.

Once the content is written, this section gets it online and keeps it there: previewing changes on your machine, building and hosting the output, adding comments and analytics, upgrading the theme, and finding out why a build or a page went wrong.

Find it by task

I want to… Read
See my changes as I write Local preview
Build the public/ directory I deploy Local preview
Publish to GitHub Pages, Cloudflare Pages, Netlify or my own server Deploy
Serve the site under a subpath such as example.com/docs/ Deploy
Keep preview deployments out of search engines Deploy
Let readers comment at the end of a page Comments
Count visits with Google Analytics, Plausible or another service Analytics and SEO
Check that search engines index the site correctly Analytics and SEO
Upgrade OINK, or migrate from Docsy or OINK 0.4 Upgrade
Fix a build error, empty search results or a 404 Troubleshooting

1 - Local preview

Watch your changes render as you save with hugo server, then build the public/ directory you deploy.

Two commands cover daily work. hugo server rebuilds the site every time you save and reloads the browser for you; hugo writes the finished site to public/, the directory you deploy:

Terminal
hugo server                                                   # preview at http://localhost:1313/
hugo --cleanDestinationDir --gc --minify --printPathWarnings  # build public/ for deployment

Neither needs Node.js, npm or a CDN. The tools they do need, Git, Go and Hugo, are listed in Get started.

The preview server

Run hugo server from the site root, the directory that holds hugo.yml, and open http://localhost:1313/. Each save, and each switch of Git branch, triggers a rebuild and a browser refresh. The first start is slower because Hugo downloads the theme module into its cache; later starts read the cache.

The switches worth knowing

-D / --buildDrafts , defaultoff
Also builds pages with draft: true
-F / --buildFuture , defaultoff
Also builds pages whose date / publishDate is in the future
-E / --buildExpired , defaultoff
Also builds pages whose expiryDate has passed
--disableFastRender , defaultoff
Re-renders the whole site on every change instead of only the pages Hugo thinks changed
-M / --renderToMemory , defaultoff (writes to disk)
Serves from memory and writes nothing to public/
-N / --navigateToChanged , defaultoff
Sends the browser to the page you just saved
--bind , default127.0.0.1
The listen address; use 0.0.0.0 to reach the server from your LAN or from outside a container
-p / --port , default1313
The listen port
--minify , defaultoff
Minifies the preview as well, to reproduce production rendering
--printPathWarnings , defaultoff
Warns when two pages write to the same output path

A good combination while writing:

Terminal
hugo server -DFE \
  --disableFastRender --renderToMemory --minify \
  --printPathWarnings --logLevel info

-DFE is short for -D -F -E, so drafts, future-dated and expired pages all appear while you work on them. --renderToMemory keeps those pages out of public/, so a later deploy cannot pick them up by accident.

A change that did not take effect

By default Hugo re-renders only what it judges affected by a change, and edits to layouts, configuration, data/ or an included file sometimes slip past that judgment. When a page looks unchanged:

  1. Restart with --disableFastRender.
  2. Force a browser reload (Cmd/Ctrl + Shift + R) to rule out the browser cache.
  3. If the page is still stale, clear the caches and restart.

Reaching it from another device

The server listens on 127.0.0.1 only, so a phone or another computer cannot reach it. Bind to every interface and give the address the other device will use:

Terminal
hugo server --bind 0.0.0.0 --port 1313 --baseURL http://192.168.1.10:1313/

Without --baseURL, the page opens but its absolute links, the stylesheet and the search index among them, still point at localhost.

Production build

Build what you deploy with hugo, never with hugo server:

Terminal
hugo --cleanDestinationDir --gc --minify --printPathWarnings

The output in public/ is self-contained, so you can copy it anywhere without the source tree. Each switch earns its place:

--cleanDestinationDir
Deletes files the current build did not write, so a page you removed does not stay live
--gc
Removes processed resources in resources/_gen that nothing references any more
--minify
Minifies the HTML, CSS, JS and XML output
--printPathWarnings
Warns when two pages claim the same output path, the most common silent error on a multilingual site

A successful build ends with a Total in … line. Read any warnings before you deploy: each one names a setting the theme ignored, and the build kept going with a safe default.

Two settings matter as soon as the output leaves your machine. baseURL decides every absolute link, including a subpath such as /docs/; see Getting baseURL right. The build environment, production for hugo and development for hugo server, decides whether pages ask to be indexed and whether analytics load; see Keeping preview deployments unindexed.

Previewing in a container

A container is optional. It helps when a team wants everyone on the same toolchain, or does not want Hugo installed on every machine.

Dockerfile
FROM debian:bookworm-slim

ARG HUGO_VERSION=0.170.1
ARG TARGETARCH

COPY --from=golang:1 /usr/local/go /usr/local/go

RUN apt-get update \
    && apt-get install -y --no-install-recommends ca-certificates curl git \
    && curl --fail --location -o /tmp/hugo.deb \
      "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-${TARGETARCH}.deb" \
    && apt-get install -y /tmp/hugo.deb \
    && rm -rf /var/lib/apt/lists/* /tmp/hugo.deb

ENV PATH="/usr/local/go/bin:${PATH}"
WORKDIR /src
EXPOSE 1313
ENTRYPOINT ["hugo"]
CMD ["server", "--bind", "0.0.0.0", "--disableFastRender"]
Terminal
docker build -t oink-hugo .

# preview: mount the site source, and the Go module cache with it
docker run --rm -it -p 1313:1313 \
  -v "$PWD:/src" \
  -v "$HOME/go/pkg/mod:/root/go/pkg/mod" \
  oink-hugo

# production build: override the default server command
docker run --rm --user "$(id -u):$(id -g)" \
  -v "$PWD:/src" \
  oink-hugo --gc --minify

Set HUGO_VERSION to the release your team builds with (OINK is tested on 0.170+). A site still pinned to OINK 1.5.1 or older needs a different package; see Upgrade.

Go is in the image because Hugo needs it to download a theme installed as a Hugo Module. A site that uses a submodule, an offline archive or a plain clone can drop Go and get a much smaller image. Nothing in the image needs Node.js, npm or PostCSS, and the build fetches no browser assets, so for a network-isolated environment you only have to mirror the base image and the Hugo and Go packages.

Do not let root write public/

A container runs as root unless told otherwise, and a public/ written by root cannot be deleted from the host without sudo. Map your user ID with --user "$(id -u):$(id -g)", as the production build command above does.

Clearing caches

Hugo keeps intermediate output in three places. Clear the smallest one that explains the symptom:

public/ , HoldsThe previous build’s output
A deleted page is still live. hugo --cleanDestinationDir does this as part of the build
resources/_gen/ , HoldsProcessed images
You changed image processing, fonts or the accent color and the page still looks old
hugo mod clean , HoldsThe Hugo Module cache
You changed the theme version and the old one still resolves. Add --all to clear the whole module cache
Terminal
rm -rf public resources/_gen
hugo mod clean          # only the modules this project uses
hugo mod clean --all    # the whole module cache; the next build downloads again

List both public/ and resources/ in .gitignore. They are regenerated on every build, and committed copies go stale and bloat the repository.

Previewing against a theme checkout

When you change the theme and the site together, point the preview at your local theme checkout for one command with HUGO_MODULE_REPLACEMENTS. go.mod stays untouched, so the substitution cannot be committed by accident:

Terminal
HUGO_MODULE_REPLACEMENTS='github.com/pgsty/oink -> /absolute/path/to/oink' hugo server

From scratch shows the directory layout and the Go workspace alternative.

A replacement hides the version you pinned

While the variable is set or a Go workspace is active, every build uses the local checkout, whatever go.mod says, and a CI job can inherit either. To build the published release, unset HUGO_MODULE_REPLACEMENTS, set GOWORK=off and HUGO_MODULE_WORKSPACE=off, look for permanent replace directives in go.mod and the Hugo configuration and for a _vendor/ copy, then confirm the exact version with hugo mod graph in that same environment. Never commit a workspace file that names a path on your machine.

Verifying an offline build

If the site must work in a network-isolated environment, test both the build and the browser with the network cut off:

  1. Start from a verified theme archive and an empty module cache (hugo mod clean --all).
  2. Block outbound HTTP, HTTPS and the Go module proxy.
  3. Run the production build hugo --gc --minify --printPathWarnings.
  4. Browse pages in every language: a documentation page, a blog page, the home page, the 404.
  5. Use search, the light/dark toggle, diagrams and the content components the site relies on.
  6. Check every subresource origin and confirm that no unexpected remote host appears.

For the last step, run the output checker from a theme checkout of the same release your site pins. It needs only Python 3. Replace both paths and use the base URL you built with:

Terminal
python3 /path/to/oink/bin/check-output-security.py \
  --public /path/to/my-site/public --base-url https://docs.internal.example.com/

The script reads every href, src, srcset, poster and form action in the HTML, print, Markdown and RSS output. Each must be a site-relative path or use http, https, mailto or tel, and inline on* handlers and javascript: URLs are rejected. An <iframe>, <script>, <link>, <img>, <video>, <audio>, <embed>, <object> or <source> that points to another host is an error. If the site embeds third-party content on purpose, pass --third-party; if its languages live on several domains, list the extra first-party hosts with --allow-host.

A pass covers that build only. Run the check again after every theme upgrade.

Verify

Start from empty caches so nothing stale hides a problem:

Terminal
rm -rf public resources/_gen
hugo --gc --minify --printPathWarnings

The build passes when it ends with Total in … and reports no ERROR. Then check:

  • The log shows no npm, PostCSS, Autoprefixer or asset-download step. One that appears comes from leftover Docsy configuration.
  • public/ contains sitemap.xml and robots.txt, and robots.txt reads Allow: /.
  • With local search enabled, public/ holds an index per language, named offline-search-index.<language>.<hash>.json in production (development builds omit the hash). Open search and confirm that the URL in the page’s data-td-index-src attribute returns 200.
  • In hugo server, a documentation page, a blog page, the home page and the 404 render correctly in every language and in both color schemes.

After deployment, repeat the checks on the live site with the deployment checklist. For a build that fails or looks wrong, see Troubleshooting.

2 - Deploy

Publish public/ to GitHub Pages, Cloudflare Pages or any static host, with the right baseURL, CI settings, security policy, checks and rollback.

An OINK site builds to a directory of static files, so any host that serves files can serve it, with no Node runtime, server-side rendering or build plugin. Deploying comes down to three things: run the production build, publish public/, and set baseURL to the address readers will use. A site created from the OINK Starter already has GitHub Pages and Cloudflare Pages workflows that do all three.

Getting baseURL right

A wrong baseURL is the most common deployment fault, and a quiet one: pages open, but the search index returns 404, page-action links point elsewhere and some assets fail to load.

At the root of a domain:

hugo.yml
baseURL: https://docs.example.com

Under a subpath such as https://example.com/docs/, include the path:

hugo.yml
baseURL: https://example.com/docs/

You can also override it at build time, which lets one source tree deploy to several addresses:

Terminal
hugo --gc --minify --baseURL "https://example.com/docs/"
Do not fix a subpath with canonifyURLs

Leave canonifyURLs at Hugo’s default, false. OINK’s templates and content links resolve against baseURL, so a wrong path means a wrong baseURL. Turning on canonifyURLs also rewrites relative links that were already correct, which makes the fault harder to find.

With local search enabled, open search on the deployed site and watch the index request in the browser’s Network panel: it must carry the right language and subpath and return 200. Take the URL from the page’s data-td-index-src attribute instead of guessing it, because production filenames include a content hash (offline-search-index.<language>.<hash>.json).

Choosing a host

If the source lives on GitHub, one Actions workflow builds the site and publishes it through the Pages deployment API, with no gh-pages branch to maintain. The OINK Starter ships this file; copy it only when you assemble a site yourself.

.github/workflows/github-pages.yaml
 1name: Deploy to GitHub Pages
 2
 3on:
 4  push:
 5    branches: [main]
 6  workflow_dispatch:
 7
 8permissions:
 9  contents: read
10  pages: write
11  id-token: write
12
13concurrency:
14  group: github-pages
15  cancel-in-progress: false
16
17env:
18  # a workspace from a sibling checkout must never take part in a CI build
19  GOWORK: off
20  HUGO_MODULE_WORKSPACE: off
21  HUGO_CACHEDIR: ${{ github.workspace }}/.hugo_cache
22
23jobs:
24  build:
25    name: Build Pages artifact
26    runs-on: ubuntu-latest
27    steps:
28      - name: Check out source
29        uses: actions/checkout@v7
30        with:
31          fetch-depth: 0
32
33      - name: Set up Go
34        uses: actions/setup-go@v7
35        with:
36          go-version: stable
37          cache-dependency-path: go.sum
38
39      - name: Configure GitHub Pages
40        id: pages
41        uses: actions/configure-pages@v6
42
43      - name: Install Hugo
44        uses: peaceiris/actions-hugo@v3
45        with:
46          hugo-version: latest
47
48      - name: Record build tool versions
49        run: |
50          go version
51          hugo version
52
53      - name: Download OINK
54        run: go mod download github.com/pgsty/oink
55
56      - name: Build
57        run: |
58          hugo --cleanDestinationDir --gc --minify --environment production \
59            --printPathWarnings \
60            --baseURL "${{ steps.pages.outputs.base_url }}/"
61
62      - name: Upload Pages artifact
63        uses: actions/upload-pages-artifact@v5
64        with:
65          path: public
66
67  deploy:
68    name: Deploy
69    environment:
70      name: github-pages
71      url: ${{ steps.deployment.outputs.page_url }}
72    runs-on: ubuntu-latest
73    needs: build
74    steps:
75      - name: Publish
76        id: deployment
77        uses: actions/deploy-pages@v5

Build settings for CI explains each setting; keep them when you edit the file. One is specific to GitHub Pages: --baseURL takes the address that configure-pages computes, https://<OWNER>.github.io/<REPO>/ for a project site, so you never hard-code it.

In the repository, set Settings → Pages → Build and deployment → Source to GitHub Actions, push to main, and watch the first run on the Actions tab.

For a custom domain, enter it under Custom domain on the same settings page, configure DNS as prompted, and set baseURL in hugo.yaml to the new domain. If your publishing process needs a CNAME file, put it at static/CNAME; Hugo copies it unchanged into public/.

The OINK Starter ships .github/workflows/cloudflare-pages.yaml, a Direct Upload workflow: the production build runs in GitHub Actions with the same build settings as the GitHub Pages workflow, and Wrangler uploads the resulting public/ to a Cloudflare Pages project. It is the recommended path for Starter sites.

  1. Create a Direct Upload Pages project. Its name defaults to the repository name; to use another, set the repository variable CLOUDFLARE_PROJECT_NAME.
  2. Add the repository secrets CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN. The token needs Account → Cloudflare Pages → Edit.
  3. Run Deploy to Cloudflare Pages once by hand. To deploy every push to main, set the repository variable CLOUDFLARE_PAGES_ENABLED=true.
  4. The canonical URL defaults to https://<project>.pages.dev/. When a custom domain becomes production, set CLOUDFLARE_SITE_URL to it.

Cloudflare’s Git integration also works, with Cloudflare running the build: set the build command to hugo --gc --minify --printPathWarnings, the output directory to public, and HUGO_VERSION to a current release such as 0.170.1 (OINK is tested on 0.170+, while Cloudflare’s default image ships an older Hugo). Choose one mode per project, Git integration or the Direct Upload workflow, and build preview deployments with their own URL and a non-production environment.

On a custom domain, Cloudflare can mistake module@version in an install command for an email address. This documentation site adds no-transform to the HTML response’s Cache-Control header in static/_headers. After deploying, open an install example on the production domain with JavaScript disabled and copy the command. Cloudflare email obfuscation

Netlify — set the build command to hugo --gc --minify, the publish directory to public, and the HUGO_VERSION environment variable. The same settings can live in the repository:

netlify.toml
[build]
command = "hugo --gc --minify --printPathWarnings"
publish = "public"

[build.environment]
# override the platform's default with a current Hugo release (tested on 0.170+)
HUGO_VERSION = "0.170.1"

A theme installed as a submodule needs recursive submodule checkout enabled; one installed as a Hugo Module needs Git and Go in the build image. Build previews with the same Hugo release as production, unless the preview exists to test an upgrade.

Vercel — set the build command to hugo --gc --minify, the output directory to public, and the HUGO_VERSION environment variable. There is no npm install step.

Any static server (Nginx, Caddy) — serve an unchanged copy of public/. The example serves /var/www/oink/current, a symlink to a release directory that the offline packaging steps below create:

/etc/nginx/conf.d/docs.conf
server {
    listen 80;
    server_name docs.example.com;
    root /var/www/oink/current;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    error_page 404 /404.html;
}

The site is purely static, so there is nothing to proxy to an application server.

Object storage — Hugo’s deploy command uploads to S3, Google Cloud Storage or Azure. Name the target in the configuration:

hugo.yml
deployment:
  targets:
    - name: aws
      URL: 's3://www.your-domain.tld'
      cloudFrontDistributionID: E9RZ8T1EXAMPLEID

After a build, hugo deploy compares the bucket with public/, uploads only what changed, and invalidates the CDN cache when cloudFrontDistributionID is set. Without --target it uses the first target; run it with --dryRun first to see what it would change. The Hugo binary must be built withdeploy (check hugo version), and the cloud credentials come from the provider’s standard environment variables or configuration file; on AWS, confirm access with aws s3 ls first.

Offline packaging — for a network-isolated server, build on a connected machine with the target’s baseURL and carry the output over as one archive. Give every archive a new release name:

Terminal
hugo --cleanDestinationDir --gc --minify --baseURL "https://docs.internal.example.com/" &&
  tar -czf oink-site-20260929-01.tar.gz -C public .

On the Linux host you need write access to /var/www/oink and GNU mv; current must be absent or a symlink, and current.next must not exist. Unpack each release into a new directory and switch current to it:

Linux host
release_dir=/var/www/oink/releases/20260929-01
mkdir -p /var/www/oink/releases
mkdir "$release_dir" &&
  tar -xzf oink-site-20260929-01.tar.gz -C "$release_dir" &&
  test -f "$release_dir/index.html" &&
  ln -s "$release_dir" /var/www/oink/current.next &&
  mv -Tf /var/www/oink/current.next /var/www/oink/current

The chain switches current only after the directory was created, the archive extracted and index.html found, and the final mv replaces the link in one step, so readers never see a half-written site. Never unpack over an existing release directory, and keep the previous one: it is your rollback. A different baseURL means a new build, not an edit of the output.

A host without Go — a theme installed as a Hugo Module needs Go in the build environment. Where the platform has none, install the theme as a Git submodule (run git submodule update --init before the build) or commit an offline archive under themes/oink/; see From scratch and other install methods.

Build settings for CI

These settings belong in any CI build of an OINK site, whichever host receives the output. The Starter’s workflows already contain them.

  • fetch-depth: 0 on checkout — with enableGitInfo, last-modified dates and contributor lists come from Git history, and a shallow clone gives every page the same date.
  • Go, then go mod download github.com/pgsty/oink — Hugo needs Go to fetch a theme installed as a Hugo Module. A submodule install checks out with submodules: recursive instead, and an offline archive is committed under themes/oink/; either way, drop both Go steps.
  • GOWORK: off and HUGO_MODULE_WORKSPACE: off — keep a developer’s Go workspace out of the build, so CI builds the release pinned in go.mod and nothing else.
  • Hugo latest — OINK uses plain CSS and is tested on Hugo 0.170+, so CI can follow current releases. A site still pinned to OINK 1.5.1 or older cannot; see Upgrade.
  • --environment production and the real --baseURL — the environment decides indexing and analytics (see below), and baseURL every absolute link.
  • --printPathWarnings, and no --panicOnWarning — OINK’s warnings are deliberate: a mistyped key or an incomplete integration warns and falls back to a safe default so the site still builds. Turning warnings into errors with --panicOnWarning or HUGO_PANICONWARNING would fail builds that are fine. Read the warnings in the build log instead.

Keeping preview deployments unindexed

Hugo’s -e / --environment changes how OINK builds, not what the site contains. Only a production build:

  • emits <meta name="robots" content="index, follow"> (other environments emit noindex, nofollow);
  • writes Allow: / and a Sitemap: line to robots.txt (other environments write Disallow: /);
  • renders the Google Analytics snippet;
  • fingerprints the theme’s scripts and stylesheets and adds SRI integrity attributes.

hugo defaults to production, even on a preview host, so build pull-request previews and staging sites with another environment:

Terminal
hugo --gc --minify --environment staging --baseURL "$PREVIEW_URL"

The output then asks search engines to stay away and sends nothing to an analytics service.

Content Security Policy

The theme’s scripts, fonts and icons are all served from your own origin, but script-src 'self'; style-src 'self' alone still blocks parts of an ordinary OINK page. The theme writes small inline scripts that set the color mode and the page shell’s state before the first paint, inline styles for the initial canvas, theme colors and font roles, and style attributes on some components; Markmap adds inline configuration and styles. OINK ships no ready-made policy, CSP hashes or nonce injection, so derive the policy from your own built output.

Features you enable add their own requirements:

  • Inline HTML and scripts that authors write under renderer.unsafe: true are the site’s to review.
  • ECharts $fn: callbacks and custom themes: the site registers its functions on window.OinkEchartsFunctions and its themes on window.OinkEchartsThemes, so the registering script’s origin belongs in script-src.
  • Analytics scripts: the script you insert, and the host it reports to.
  • Local PlantUML rendering: same-origin scripts, wasm-unsafe-eval in script-src to compile WebAssembly, and blob: in img-src. No rendering-service origin is needed.
  • Remote API specifications and self-hosted diagram services: their origins in connect-src and img-src.
  • giscus: both script-src and frame-src.
  • Interactive maps (params.map): your tile and dark_tiles hosts in img-src.
  • Video platform players (params.video_embeds): the enabled player origins (https://www.youtube-nocookie.com, https://player.bilibili.com, https://player.vimeo.com) in frame-src, plus any remote media, poster, subtitle track or social-avatar hosts in media-src, img-src and connect-src.
  • Duo view and ReDoc API references render in same-origin frames, so frame-src (or child-src) must allow 'self', and responses must allow same-origin framing (no X-Frame-Options: DENY or frame-ancestors 'none'). Duo view also adds an inline bootstrap script to every HTML page, which changes the script hashes.

Hash each inline script and style block you allow from the final deployed bytes, or have the host inject a fresh nonce into both the policy header and the matching tags on every response. A <style> nonce does not cover style="…" attributes, which need style-src-attr of their own. Hashes change with content, configuration, minification and theme upgrades, so recompute them after each.

Start from a minimal policy that covers only the features you have reviewed, and add permissions one at a time: keep ECharts options as pure data when no callback is needed, review author-written inline scripts, and add a remote origin only for an integration the site explicitly enabled. The output checker in Verifying an offline build lists every subresource origin, which is a good starting inventory. Ship the policy as Content-Security-Policy-Report-Only first, and enforce it only after light/dark startup, shell state, menus and every enabled component work in the browser.

Acceptance checklist

Go through this table after each deployment. The first four rows can be checked in the build output; the rest need the real URL.

The build succeeded and you read its warnings
The log of a build with --printPathWarnings ends with Total in …
baseURL is correct
<link rel="canonical"> in the page source points at the real production address, subpath included
Sitemap
<baseURL>/sitemap.xml resolves; on a multilingual site it is an index pointing at /en/sitemap.xml, /zh/sitemap.xml and so on
robots
<baseURL>/robots.txt reads Allow: / with a Sitemap: line; a preview deployment reads Disallow: /
Search index
With local search enabled, the URL in data-td-index-src returns 200, its filename carries a hash, and site search returns results
Markdown output
Where the site enables markdown under outputs.page, appending index.md to a page URL returns plain text
llms.txt
Where the site enables LLMS under outputs.home, the root of every enabled language serves llms.txt
Every language
Documentation, blog and home pages open in each, and the language switcher lands on the matching page rather than the home page
Appearance and interaction
The light/dark toggle, the print view and common components (callouts, tabs, code-block copy) work
404
A path that does not exist shows the site’s own 404 page

The switches for sitemap.xml, robots.txt, .md and llms.txt are in Configuration, and the agent-facing outputs are described in AI-agent support.

Rollback

Roll back a static site by publishing the last known-good build again. Never patch files on the production host, because the next deploy silently undoes the patch and nothing records what changed.

  • GitHub Pages: find the last successful Deploy to GitHub Pages run under Actions and choose Re-run all jobs, or git revert the faulty commit and push.
  • Cloudflare Pages, Netlify, Vercel: pick the last good deployment in the platform’s list and promote it with Rollback or Publish deploy.
  • Your own static server: point current back at the previous release directory kept by offline packaging. Do not extract the old archive over the new files; paths that only the newer release added would stay live.

On the Linux host, with the same symlink and GNU mv prerequisites as above, replace the example with the release you kept:

Terminal
previous_release=/var/www/oink/releases/20260928-01
test -d "$previous_release" &&
  ln -s "$previous_release" /var/www/oink/current.next &&
  mv -Tf /var/www/oink/current.next /var/www/oink/current

Then open an old page at the public URL, and confirm that a path only the rejected release added is gone.

If a theme upgrade caused the problem, roll back the version pin in go.mod instead; see Upgrade.

3 - Comments

Add a comment thread to each page with giscus and GitHub Discussions, choose which pages carry one, and match it to the site’s colors.

Comments give every page its own discussion thread at the end, with no comment server to run. OINK uses giscus, which stores each page’s thread as a GitHub Discussion in a repository you choose: readers sign in with GitHub to post, and you moderate in GitHub Discussions like any other discussion. The theme has no comment backend of its own and bundles no other provider.

The repository must be public, because visitors cannot read the Discussions of a private one.

Comments load a third-party service

A page with comments loads a script and an iframe from https://giscus.app, so they cannot work in a network-isolated environment. Comments stay off until you configure them; once on, mention giscus and GitHub in the site’s privacy policy if it has one.

Enabling it site-wide

The whole configuration lives under params.comments. Replace the four placeholders with the values giscus.app generates for your repository, as the next two sections describe:

hugo.yml
params:
  comments:
    enable: true
    type: giscus
    giscus:
      repo: YOUR_OWNER/YOUR_REPO
      repoId: YOUR_REPO_ID
      category: YOUR_CATEGORY
      categoryId: YOUR_CATEGORY_ID
      mapping: pathname
      inputPosition: bottom
      theme: auto
      loading: lazy

repo, repoId, category and categoryId are required and must all describe the same repository and Discussion category. If any of them is missing or blank, the build prints one warning and renders no comments, so read the build log before you publish. type accepts only giscus; any other value also warns and renders nothing. The key names match Hextra’s params.comments, so a configuration moved from Hextra works unchanged.

Every other key has a default, listed in Configuration: mapping (pathname), inputPosition (top), theme (auto), loading (lazy), strict, reactionsEnabled, emitMetadata, term, lang, lightTheme, darkTheme, ariaLabel and errorMessage. The giscus switches accept a YAML boolean or giscus’s own 0 / 1.

Preparing the GitHub repository

  1. Choose a public repository to hold the threads. The site’s own source repository works.

  2. Under the repository’s Settings → General → Features, turn on Discussions.

  3. Install the giscus GitHub App on that repository. Without it, visitors can neither comment nor react.

  4. Pick a Discussion category. giscus recommends one of the Announcements type, where only maintainers and the giscus bot can open a Discussion, so readers cannot start stray threads.

The repository ID and category ID are public identifiers, not credentials. Never put a personal access token, an OAuth secret or a password in the Hugo configuration: it is published with the site’s source.

Generating the configuration

Open giscus.app, enter the repository, the mapping and the category, and the page generates a <script> block. Copy four of its attributes into the OINK configuration:

data-repo
repo
data-repo-id
repoId
data-category
category
data-category-id
categoryId

mapping decides which Discussion belongs to which page. OINK’s default, pathname, suits a site whose published paths are stable, and lets one repository serve several domains or preview environments.

Settle the mapping before launch. If you change it, or move a page, after comments exist, giscus looks for a different Discussion: the old comments are not deleted, but the page no longer finds them. When a URL has to change, keep a redirect or rename the Discussion at the same time.

Per-page control

A page’s comments front matter overrides the site switch in either direction, and the value nearest the page wins.

To allow comments on a few pages only, set enable: false site-wide but keep the rest of the configuration, then turn comments on per page:

content/blog/2026-roadmap.md
---
title: 2026 roadmap
comments: true
---

To keep comments everywhere except a few pages, leave the site switch on and turn them off where discussion does not belong:

content/about/security.md
---
title: Security policy
comments: false
---

For a whole section, use a cascade. This site sets comments: true in the cascade of content/docs/_index.md, which is why a giscus thread appears at the end of this page:

content/docs/_index.md
---
title: OINK Documentation
cascade:
  type: docs
  comments: true
---

If the site also sets services.disqus.shortname, a working giscus configuration takes precedence and Disqus does not load, and comments: false on a page turns off both. When a required giscus key is missing, giscus is skipped with a warning and Disqus loads instead.

Multilingual text

The giscus interface follows the page’s language. Simplified, Traditional and Hong Kong Traditional Chinese each map to their own giscus locale, and languages giscus does not support fall back to English. Set lang only when the automatic choice is wrong.

OINK adds two strings of its own, the comment section’s accessible label and the message shown when loading fails, and translates both in every interface language it ships. To change their wording, set ariaLabel and errorMessage per language; a language layer needs only the values that differ, and the repository keys stay in params.comments:

hugo.yml
languages:
  en:
    params:
      comments:
        giscus:
          ariaLabel: Discussion
          errorMessage: The discussion could not be loaded. Please try again later.
  zh:
    params:
      comments:
        giscus:
          ariaLabel: 讨论
          errorMessage: 讨论区加载失败,请稍后重试。

Following light and dark

With theme: auto, the comment frame follows the reader’s light/dark choice and visual preset, using stylesheets the theme ships to match each preset the site offers.

To use other colors, set lightTheme and darkTheme, each to a giscus built-in theme name or to the URL of a stylesheet on your site, such as /css/giscus-brand-dark.css served from static/. They then apply under every preset. A fixed theme name in theme stops the frame from following the toggle at all.

hugo.yml
params:
  comments:
    giscus:
      theme: auto
      lightTheme: light
      darkTheme: dark_dimmed
Site-hosted giscus stylesheets must be readable cross-origin

The giscus frame runs on giscus.app and reads its stylesheet from your site, the theme’s own or yours, so the response must allow cross-origin reads. Configure Access-Control-Allow-Origin on the production host. For hugo server, this site adds Access-Control-Allow-Origin: '*' under server.headers in hugo.yml.

Privacy and CSP

  • OINK never asks for or stores a reader’s GitHub password or token; signing in and posting happen entirely on giscus and GitHub.
  • The comment loader is a same-origin script that the theme adds only to pages with comments enabled.
  • The giscus script is requested when the reader comes within a scroll of the comment section, or is already past it; with loading: lazy the iframe waits the same way. A visit returning from GitHub sign-in, and a site that sets loading: eager, request it at once.
  • Under a strict Content Security Policy, allow giscus in both script-src and frame-src. Merge these into your existing policy rather than replacing it; the general rules are in Content Security Policy.
CSP fragment
script-src 'self' https://giscus.app;
frame-src 'self' https://giscus.app;

If the script fails to load or never creates its iframe, OINK ends the loading state and shows errorMessage in a live status region, so the page never hangs on “loading”.

Verify

Terminal
hugo --minify # a missing required key prints a warning and disables comments
hugo server --disableFastRender
  1. Open a page that should have comments. giscus appears at the end with “Sign in with GitHub”, in the page’s language.
  2. Switch between light and dark. With theme: auto, the comment section follows.
  3. Open a page with comments: false and confirm that no comment section appears there.
  4. Post a test comment, then check on GitHub that a Discussion appeared in the chosen category and that you can manage it.

Until the first comment or reaction creates a page’s Discussion, a “discussion not found” message in the browser console is expected.

When comments do not appear, check in this order: build warnings about the four required keys; params.comments.enable and type; the page’s comments front matter; whether the repository is public, has Discussions on and has the giscus App installed; and the browser console and response headers for a CSP block on giscus.app. When existing threads go missing, restore the original mapping and page path first.

4 - Analytics and SEO

Connect Google Analytics or another service if you want visit counts, and check the canonical, hreflang, social-card, sitemap and robots output search engines read.

An OINK site reports nothing to anyone until you connect an analytics service: Google Analytics through one Hugo setting, anything else through a one-file hook. The theme loads no analytics, form or advertising script of its own, so the decision, and the line in your privacy statement, are yours.

Search-engine metadata, by contrast, needs no setup. Every page gets a canonical link, hreflang links to its translations, a robots meta tag and Open Graph and Twitter cards; your part is a correct baseURL and a description on each page.

Connecting Google Analytics

Put your GA4 measurement ID in Hugo’s service configuration:

hugo.yml
services:
  googleAnalytics:
    id: G-YOUR_MEASUREMENT_ID

The snippet loads only in production builds, so hugo server reports nothing. hugo builds for production by default, even on a preview host, so build pull-request and staging deployments with another environment, as Keeping preview deployments unindexed shows. Without an ID nothing loads, and a Universal Analytics UA- ID is no longer accepted: it produces a build warning instead of a snippet.

Use only this key; the top-level googleAnalytics key is deprecated. If you do not want analytics, delete the block rather than leaving a placeholder, because a placeholder ID still loads Google’s script.

Google Analytics leaves your network

Once configured, page views and events go to Google, which rules it out for a network-isolated site, and a strict Content Security Policy has to allow it; see Content Security Policy.

Connecting another analytics service

Plausible, Umami, Matomo and similar services need only their script on the page. The theme renders two hook partials for exactly this, so you add a file to your site and leave the theme untouched:

layouts/_partials/hooks/head-end.html , InsertedBefore </head>, ahead of the Google Analytics snippet
Analytics scripts, cookie-consent scripts, meta tags the theme does not write
layouts/_partials/hooks/body-end.html , InsertedAfter all the page’s other scripts
Third-party code that affects interaction rather than the first paint

For Plausible, use the domain registered in your own account:

layouts/_partials/hooks/head-end.html
{{ if hugo.IsProduction }}
<script defer data-domain="your-site.example"
        src="https://plausible.io/js/script.js"></script>
{{ end }}

Keep the hugo.IsProduction guard. Without it, every local preview by every author reports visits to your analytics account.

head-end runs before Google Analytics

A cookie-consent script placed in head-end.html therefore runs first and can stop analytics from starting.

The “was this page helpful?” widget is separate and off by default. It makes no request of its own and records answers through your Google Analytics integration when one exists; see Repository links and page info.

Duo view panes

If you enable Duo view (params.ui.compare), opening it loads both pages in same-origin frames. The Google Analytics integration (services.googleAnalytics.id) skips those panes, so opening the reader does not count two extra page views. To do that, OINK renders the snippet from its own pane-aware template instead of Hugo’s built-in one, so an override at layouts/_partials/google_analytics.html has no effect while Duo view is on.

Scripts in head-end.html still run in every pane. Check window.OinkComparePane before recording a page view:

layouts/_partials/hooks/head-end.html
{{ if hugo.IsProduction }}
<script>
  if (!window.OinkComparePane) {
    var script = document.createElement('script');
    script.defer = true;
    script.dataset.domain = 'your-site.example';
    script.src = 'https://plausible.io/js/script.js';
    document.head.appendChild(script);
  }
</script>
{{ end }}

Server and CDN logs see the pane requests too; they carry the query oink_compare_pane=1, which you can filter on.

Page descriptions

<meta name="description"> takes the first non-empty value of:

  1. The page’s description front matter
  2. The page summary Hugo computes (.Summary)
  3. params.description in the site configuration

So one description per page is the only SEO work an author has to do, and it pays three times: as the snippet under the search-engine result, as the card subtitle on its section’s index, and as the preview in site search.

content/docs/install.md
---
title: Install PostgreSQL
description: Install PostgreSQL 18 from the official packages on Debian, Ubuntu or RHEL and start the first cluster.
---

On a multilingual site, write the description in each language instead of copying the English one, and set the site-wide fallback per language too:

hugo.yml
languages:
  en:
    params:
      description: A Hugo theme for engineering docs
  zh:
    params:
      description: 为工程而设计的 Hugo 文档主题

canonical and hreflang

Every page gets one canonical link, plus an hreflang alternate for each translation that actually exists. Nothing needs configuring:

rendered output (this page)
<link rel="canonical" href="https://oink.pgsty.com/docs/admin/analytics/">
<link rel="alternate" hreflang="en-US" href="https://oink.pgsty.com/docs/admin/analytics/">
<link rel="alternate" hreflang="zh-CN" href="https://oink.pgsty.com/zh/docs/admin/analytics/">

The hreflang codes come from each language’s locale (en-US and zh-CN on this site), and the links follow Hugo’s translation pairing. A page without a translation gets no hreflang or og:locale:alternate for the missing language, even though the language switcher still offers that language’s home page.

Each page of a paginated blog index has its own canonical URL. From page 2 on, it carries no hreflang alternates, because the languages can have different numbers of posts and their page boundaries do not line up.

Canonical links are built from baseURL. A wrong baseURL sends search engines to addresses that do not exist, which is harder to notice than a failed build, so go through the deployment checklist before launch. Language configuration itself is covered in Languages.

Social cards

The theme calls Hugo’s built-in Open Graph and Twitter card templates, which fill in the title, description, URL, language and site name:

rendered output (this page)
<meta property="og:title" content="Analytics and SEO">
<meta property="og:type" content="article">
<meta property="og:url" content="https://oink.pgsty.com/docs/admin/analytics/">
<meta property="og:locale" content="en_US">
<meta property="og:locale:alternate" content="zh_CN">
<meta name="twitter:card" content="summary">

To show an image when the link is shared, set images in the page’s front matter:

content/blog/release-3.0.md
---
title: Version 3.0 released
images: [/images/release-3.0.webp]
---

For a site-wide fallback image, set the same key under params:

hugo.yml
params:
  images: [/images/social-card.webp]

With an image, twitter:card becomes summary_large_image and the output gains og:image and twitter:image. This site sets neither key, which is why the output above has no image tags.

Sitemap

Hugo writes the sitemap itself; on a multilingual site it writes an index that points at one sitemap per language:

the structure under public/
sitemap.xml        ← the index, pointing at the two below
en/sitemap.xml
zh/sitemap.xml

The site default and the per-page override are both Hugo’s own keys:

hugo.yml
sitemap:
  changefreq: monthly
  filename: sitemap.xml
  priority: 0.5
content/release/notes.md
---
title: Release notes
sitemap:
  priority: 0.8
---

Search engines treat changefreq and priority as hints and may ignore them. What matters more is checking before launch that drafts, private content and non-canonical copies stay out of the sitemap, and that every language has its own.

robots.txt and staying unindexed

Hugo writes robots.txt only when the site asks for it:

hugo.yml
enableRobotsTXT: true

The theme supplies the content, which depends on the build environment:

a production build
User-agent: *
Allow: /

Sitemap: https://oink.pgsty.com/sitemap.xml
a non-production build
User-agent: *
Disallow: /

The page’s robots meta tag follows the same rule: index, follow in a production build, noindex, nofollow otherwise and always in print output.

The theme has no per-page noindex switch. To keep a page out of search engines reliably, do not publish it: use draft: true or Hugo’s build options. If the page must be published yet unindexed, write your own tag in the head-end.html hook; the page then carries two robots tags, and each search engine decides how to combine them.

Checking indexing

A week or two after launch, confirm that search engines see the site you think you published:

  1. Crawl permission: <baseURL>/robots.txt reads Allow: /, not Disallow: /.
  2. Page inventory: <baseURL>/sitemap.xml opens; follow it to a language sitemap and check the page count.
  3. Indexed pages: a site:yourdomain search returns about the right number. The order of magnitude is enough.
  4. Canonical addresses: results open the canonical URL, not a version with ? parameters or an old domain.
  5. Submission: add the site to Google Search Console and Bing Webmaster Tools and submit the sitemap.xml address, which gets it crawled sooner than waiting.

Verify

Run this from the site root, with PAGE set to a page your site generates (including any language prefix):

Terminal
hugo --gc --minify --printPathWarnings
PAGE=public/docs/getting-started/index.html
test -f "$PAGE"

# Canonical should use the real production address; production robots allow indexing.
grep -o '<link[^>]*canonical[^>]*>' "$PAGE"
grep -o '<meta[^>]*robots[^>]*>' "$PAGE"
cat public/robots.txt
head -5 public/sitemap.xml

# No match is expected when Google Analytics is not configured.
grep -o '<script[^>]*googletagmanager[^>]*>' "$PAGE"

In the browser’s Network panel, confirm that analytics requests carry your measurement ID or registered domain. A deployment built with --environment staging must make no analytics request, and a site with no analytics configured makes none in either environment, though other integrations you enabled still contact their own services.

  • Deploy — baseURL, the checklist and unindexed preview deployments
  • Repository links and page info — the feedback widget, edit links and last-modified dates
  • Languages — language configuration decides hreflang and translation pairing
  • AI-agent support — the .md output and llms.txt written for models
  • Configuration — services, sitemap, enableRobotsTXT and the rest

5 - Upgrade

Move a site to a newer OINK release, or migrate it from OINK 0.4 or Docsy, with a rollback path at every step.

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.

Upgrade Hugo and OINK together

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:

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:

Terminal
hugo mod get github.com/pgsty/oink@v1.8.0   # the published release tag
hugo mod tidy
hugo mod graph | grep github.com/pgsty/oink

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:

go.mod
module github.com/example/product-docs

require github.com/pgsty/oink v1.8.0

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:

Terminal
git -C themes/oink fetch origin --tags
git -C themes/oink checkout --detach v1.8.0
git add themes/oink

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

Terminal
rm -rf public resources/_gen
env -u HUGO_MODULE_REPLACEMENTS GOWORK=off HUGO_MODULE_WORKSPACE=off \
  hugo --gc --minify --printPathWarnings --logLevel info

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:

Documentation / Book
Sidebar order, paging, headings, page actions, numbering and cross-references
Blog
Chronological paging, RSS ownership, navbar and footer
Home / landing
Content with JavaScript off, the compact menu, print
Release pages
Derived download URLs, checksums, publication state
Components
One page for each component the site uses most
Accessibility
Keyboard-only use, focus order, both color schemes, forced-colors mode
Deployment
Every internal link and asset keeps the base path prefix

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:

Terminal
hugo mod get github.com/pgsty/oink@v1.6.0   # example: the site's last known-good tag
hugo mod tidy
rm -rf public resources/_gen
hugo --gc --minify
  • 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). github and news join the preset list, ink is 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, set params.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) and Color (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__controls row, 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__progress element should update to .td-media__controls and .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 legacy social shortcode calls, convert them with python3 bin/migrations/oink06.py migrate --site <dir> --only social --write from the theme repository, then run python3 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, set params.ui.theme_color: '#2b5f8c'. Terminal now sets screen prose in IBM Plex Mono (keeping IBM Plex Sans in print), and an explicit params.ui.fonts.ui or fonts.body reaches the headings in every preset unless fonts.heading names its own face. See Brand and appearance. OINK 1.8.0 returns Paper to its 1.6.0 look and adds preset: 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 H to Z (H opens local browsing history), language cycling is X, preset cycling is T, color mode is Y, blog index layout is L, version cycling is V, language home is G, command-only palette stays on \ (with C), and [ and ] trigger ChatGPT and Claude. G no longer opens the focused tree item (Enter and Space still do), and the home page’s N section alias is gone (J remains). 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 matter rich_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.map or params.video_embeds, allow your tile origin in img-src and enabled video hosts in frame-src; see Deploy.
  • Archived-version banner. Sites with params.archived_version: true now receive a styled role="note" notice and require a non-empty params.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). Remove extended: true from CI workflows once every branch you build uses OINK 1.6.0 or newer.
  • Stylesheets. Convert retired assets/scss/_*_project*.scss files to plain CSS in assets/css/project.css, change hard-coded /scss/*.css paths to /css/*.css, and switch custom-shell layouts to partial "css/bundle.html". See Retired SCSS hooks.
  • Bootstrap JavaScript. Remove dependencies on a theme-provided window.bootstrap or on data-bs-toggle hooks, listen for td:tab-shown instead of shown.bs.tab on Landing download tabs, and change .dropdown-menu selectors on version lists to .td-version-menu__list. See Bootstrap’s JavaScript.
  • Local search. Remove site-script dependencies on window.lunr and call OinkSearchEngine.create(documents, maxResults). A content index over 2 MiB now moves page text into offline-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, siblingGap and colorDepth; 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’s hide-hostname, hide-logo, suppress-warnings, lazy-rendering and native-scrollbars defaults are gone with its v2 API; if you override the redoc shortcode or its styles, port those overrides to the ReDoc 3 API. Rename the specification extension x-code-samples to x-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.

  1. Move the rules in _styles_project.scss, and in the partials it imports, to assets/css/project.css as 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 &-.
  2. 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.
  3. Build the site and compare the pages that matter. project.css loads 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.
  4. 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:

  1. The theme no longer ships Lunr. If your own layouts or scripts used window.lunr from the theme’s copy, load Lunr yourself.
  2. If you call OinkSearchEngine.create directly, drop the Lunr argument: create(documents, maxResults).
  3. Results rank differently. A short word no longer matches inside another word, so port no 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 version must print extended.

  • In GitHub Actions, give peaceiris/actions-hugo an exact release and the Extended edition:

    the Install Hugo step of the workflow
    - name: Install Hugo
      uses: peaceiris/actions-hugo@v3
      with:
        hugo-version: 0.169.0
        extended: true
  • In the container image, install hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.deb instead of hugo_${HUGO_VERSION}_linux-${TARGETARCH}.deb, with HUGO_VERSION no 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: false for any language that should neither show the reader nor appear as a target language.
  • Guard custom analytics in head-end.html with window.OinkComparePane so pane loads are not counted twice. A local override of Hugo’s google_analytics.html partial is not used while compare is 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 with X-Frame-Options: DENY or frame-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

Paper became the default appearance

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: false or params.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.
Groups
sidebar_divider: true keeps a section’s children. Add build.render: never only if you mean to omit the group’s own outputs, then check child navigation, breadcrumbs, paging, Print and Book contents.
Root menus
An explicit sidebar_root_menu: false now applies to self-root sections too. The current linkable root stays visible as a location marker.
Custom scripts
Feature-detect OinkSidebar and OinkCommandPalette.registerSearchTail if an integration must also support 1.0.0. Restore branch state through the API rather than by changing classes or ARIA attributes.
Copying articles
With image zoom on, copying an image and its caption yields plain text and rich HTML. Preview instructions must stay out of the copied article, and zoom and its keyboard controls must still work.
Print and Redoc
Check page and Book aggregate Print, heading and tab links, and local Redoc specifications under the real deployment prefix. Local specification paths are rooted under static/.

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, book and blog pages end with previous / next links; documentation follows the sidebar tree and blog posts follow time. Set pager: false on 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: false in a cascade.

  • The footer defaults to fat across the site and accepts only fat, slim or none. Footer data lives in data/footer/<language>.yaml, or data/footer.yaml on a single-language site; a footer key left in data/home warns 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-code wrapper now encloses the original .highlight, and both .highlight and .chroma remain. In site CSS, replace a child selector such as .td-content > .highlight with the descendant selector .td-content .highlight.

  • The two ICP footer keys footer_icp and footer_icp_url became one string that accepts inline Markdown:

    hugo.yml
    params:
      footer_center_info: '[京ICP备00000000号](https://beian.miit.gov.cn/)'
  • Mathematics needs Goldmark passthrough in the site’s own configuration, because Hugo does not merge a theme’s markup settings. If the site uses \(…\), \[…\] or $$…$$, enable passthrough in its hugo.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:

Terminal
git clone https://github.com/pgsty/oink
cd oink

# 1. read-only inventory: what several sites would change, exportable as Markdown / JSON
python3 bin/migrations/oink06.py report --sites ~/sites/product-docs ~/sites/handbook --md report.md

# 2. dry run: prints a diff and counts per file, writing nothing
python3 bin/migrations/oink06.py migrate --site ~/sites/product-docs

# 3. apply: written atomically
python3 bin/migrations/oink06.py migrate --site ~/sites/product-docs --write

# 4. check for residue: exit code 1 while legacy syntax remains
python3 bin/migrations/oink06.py check --site ~/sites/product-docs
  • A dry run is the default and only --write changes files, so run it, read the diff, then write.
  • A second run must change nothing. If a second --write still 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:line and 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:

Terminal
python3 bin/migrations/oink06.py migrate --site ~/sites/handbook --only callout,tabs --write

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

{{%/* alert color= title= */%}}, {{%/* details */%}}, {{%/* pageinfo */%}}, hand-written <details><summary> , The current form> [!TYPE] Title / > [!DETAILS]-
callout
{{</* tabpane */>}} + {{%/* tab header= */%}}, {{</* code-group */>}} + {{</* code-tab */>}} , The current formAdjacent fences with {tab= group= value=}; tabs in running text use {{</* tabs */>}} + {{</* tab */>}}
tabs
{{</* filetree */>}} with filetree/folder and filetree/file , The current formThe filetree data fence
filetree
{{</* gallery */>}} with gallery/image , The current formThe gallery data fence
gallery
{{</* echarts */>}}, {{</* infographic */>}} , The current formData fences of the same name ($fn: is unchanged; a js subfence moves to window.OinkEchartsFunctions)
datafence
doc-cards / doc-card, nav-cards / nav-card, card / cardpane, doc-carousel , The current form{{</* cards */>}} + {{</* card */>}}, or a link list with {.cards}
cards
{{</* imgproc */>}}, {{</* image */>}} , The current form![alt](src) with the attribute line {command= options= caption=}
image
{{</* readfile file= */>}} , The current form{{</* include file= */>}}
include
The fence attribute {filename="x"} , The current form{title="x"}
fencetitle
{{</* badge outline= */>}} , The current formDrop the outline parameter
badge
{{</* example */>}} + a fence, {{</* book-figures kind="tbl" */>}} , The current form{{</* eg */>}}…{{</* /eg */>}}, {{</* book-tables */>}}
eg
{{%/* _param x */%}}, iframe, conditional-text, blocks/*, netlify, a kindless xref , The current formReported only; handle by hand
reportonly

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.

  1. Pin the target version. Point go.mod at an OINK release tag, or use a complete versioned archive. While you evaluate, an uncommitted go.work can point at a local checkout.

  2. Inventory the overrides. Sort every site-level file under layouts/, assets/ and static/ 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 emptying layouts/ at once, because the home or download page may still call a partial you plan to remove.

  3. Move the configuration. title, languages.*, github_repo, github_branch, page_width and params.ui.* keep their meaning and position; OINK adds no namespace of its own. Turn on search and the logo with these keys:

    hugo.yml
    params:
      logo: img/product.svg
      offline_search: true

    Rename Docsy’s camelCase search keys yourself: offlineSearch, offlineSearchIndex, offlineSearchMaxResults, offlineSearchOnServe and offlineSearchSummaryLength all become their underscored forms. OINK ignores the old names without a warning, so search stays off silently until you rename them.

  4. 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.

  5. Convert the shortcodes. Docsy’s alert, pageinfo, tabpane and card families all have a current counterpart; convert them in bulk with the migration toolkit, one --only class at a time.

  6. 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.html and the shared docs and blog baseof*.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 and param shortcodes;
  • 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:

layouts/_partials/hooks/head-end.html
<script src="{{ (resources.Get "js/jquery.min.js").RelPermalink }}"></script>

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.

6 - Troubleshooting

Find the cause and fix of a build, language, search or hosting problem from its symptom, and check a site before you publish it.

When a build fails or a page looks wrong, start from a clean production build and read the first error, because later errors usually follow from it:

Terminal
rm -rf public resources/_gen
hugo --gc --minify --printPathWarnings --logLevel info

That one Hugo command is the whole build of an OINK site. If the log shows npm, PostCSS, Autoprefixer or a browser-asset download, the site still carries upstream Docsy’s build steps; see Migrating from Docsy.

Build

Symptom Cause Fix
Build fails on an older Hugo release The Hugo that runs is older than the tested 0.170+ releases Check hugo version and update to a current release (0.170+). If several Hugo binaries are installed, check PATH and the version configured in CI before installing another
TOCSS-DART: … You need to install Dart Sass The site pins OINK 1.5.1 or older, which compiles Sass, and Hugo 0.170 or newer no longer has a built-in Sass compiler Upgrade the site to the current OINK release, see Upgrade to 1.6.0, or build it with Hugo Extended 0.169 or older until you do
module "github.com/pgsty/oink" not found The theme did not resolve Hugo Module: check hugo mod graph, go.mod, go.sum, and unexpected workspaces or replacements. Submodule: confirm that CI runs git submodule update --init before Hugo. Archive / clone: theme: must match the directory name under themes/
Module download hangs or times out The Go module proxy is unreachable Hugo downloads modules through Go, so GOPROXY applies. In mainland China, use export GOPROXY=https://goproxy.cn,direct. In an isolated environment, use an offline archive or commit themes/oink/
{.cards}, {.steps}, {caption=…} appear as literal text Goldmark block attributes are off Set markup.goldmark.parser.attribute.block: true in the site’s own hugo.yml; Hugo does not merge a theme’s markup settings. Copy the whole block from the three Goldmark prerequisites
An image with an attribute line is wrapped in <p> and the caption does nothing markup.goldmark.parser.wrapStandAloneImageWithinParagraph: false is missing Add it, from the same block
Inline HTML is escaped into text markup.goldmark.renderer.unsafe: true is missing Add it, from the same block
\(…\) $$…$$ display literally Goldmark passthrough is off See Math. math: true does not turn passthrough on
shortcode "tabs" must be closed or self-closed A {{</* tabs */>}} has no matching {{</* /tabs */>}} Add the closing marker at the file:line:column the error names
template for shortcode "tabs" not found The body calls a shortcode that does not exist, or quotes shortcode syntax without escaping it Correct a misspelled name. To show shortcode syntax as text, put /* and */ inside the opening and closing markers, so Hugo does not treat it as a call
... attributes: unknown attribute "witdh" at ... An attribute-line key is misspelled or not permitted Correct the key; the warning lists the allowed ones. Until then the theme ignores the attribute, and it always drops style and on*
shortcode "field": unsupported parameter "colour" at ... A shortcode parameter name is wrong Correct the parameter the warning names, with its file and line. Until then the theme ignores it, so the preview keeps working
invalid params.ui.page_width "widee" (allowed: normal | wide | full) -- using "normal" A configuration or front matter value is outside its allowed set Correct the value the message names. Until then the theme uses the fallback it names and keeps building; see Configuration principles
A page setting has no effect and nothing is reported The key was written inside a ui: block in front matter Put page keys at the top level of front matter, without the ui. prefix of the site key. A front matter ui: block is ignored silently. See Page parameters
The build passes but production is missing a feature A warning turned the feature off Read the build warnings. An invalid value, a missing required giscus key or an unsupported comments.type switches that feature off instead of failing the build
Site styles disappear after an upgrade, with a stylesheet: assets/scss/… is ignored warning The site still has a retired SCSS hook Move its rules to assets/css/project.css; see Retired SCSS hooks

Both shortcode errors end with the file:line:column to fix:

build output
ERROR error building site: assemble: failed to create page from pageMetaSource /a:
  "…/content/docs/x.md:4:1": failed to extract shortcode:
  shortcode "tabs" must be closed or self-closed

ERROR error building site: assemble: failed to create page from pageMetaSource /a:
  "…/content/docs/x.md:4:5": failed to extract shortcode:
  template for shortcode "tabs" not found

Language

Symptom Cause Fix
A translated page does not appear Four possibilities, in order ① hugo.yml has languages.zh with a weight; ② the filename is page.zh.md, with zh lowercase; ③ the translation’s front matter has no draft: true and no future date; ④ routing metadata matches the source file
Switching language lands on the home page Hugo found no translation The switcher falls back to the target language’s home page when a page has no translation. Add the translation file to link the two pages
An anchor link opens the page but does not scroll The translated heading text differs, so the generated ID does too Set the English ID explicitly on the translated heading: ## 安装 {#installation}. If a heading contains a shortcode or inline HTML, read its ID from the English page’s rendered HTML instead of guessing
Menus or home page sections are untranslated They live in configuration and data files, not pages Menus are in languages.<lang>.menus, home sections in data/home/<lang>.yaml, interface strings in i18n/<lang>.yaml. See Languages
Symptom Cause Fix
A search box that never returns results No index was generated Check params.offline_search, then open search and find the request for the page’s data-td-index-src URL in the network panel. Production uses offline-search-index.<language>.<hash>.json; development omits the hash. If the index is missing only under hugo server, also check offline_search_on_serve
The index file returns 404 A wrong baseURL On a subpath deployment, a wrong baseURL is the most common cause. Check the requested index URL in the browser’s network panel; see Deploy
Search fails under hugo server but works in a build The site turned the preview index off params.offline_search_on_serve defaults to true, so the preview matches production. Remove an explicit false
Chinese queries find nothing Usually the page is missing from the index, or its text sits in the split body file Open the Chinese page’s data-td-index-src URL, and data-td-body-src if the index is split, to confirm the page was indexed, and check the offline_search_index scope. See Chinese, mixed queries, and identifiers
A new page is not found while old ones are The index is build output Rebuild. Under hugo server, wait for the rebuild after editing
params.search.algolia requires explicit appId, apiKey, and indexName values The three Algolia keys are incomplete Give all three explicitly; the theme never falls back to another project’s DocSearch credentials. If you do not want Algolia, delete the block
The command palette finds no content Commands and full-text search are separate Without an index the palette still opens, says the index is unavailable, and runs page actions and commands. See Command palette

Platform

Symptom Cause Fix
A 404 or missing styles on GitHub Pages A project site’s URL carries the repository path and baseURL does not Pass --baseURL "${{ steps.pages.outputs.base_url }}/" from the workflow instead of hard-coding the address. See the complete workflow in Deploy
“Last modified” and contributors are empty on GitHub Pages The checkout is shallow Add fetch-depth: 0 to actions/checkout, because enableGitInfo reads the complete history
A Cloudflare Pages build fails with Hugo template errors The build image’s default Hugo is outdated Set HUGO_VERSION to a current release (for example 0.170.1) in both the Production and Preview environments, and set SKIP_DEPENDENCY_INSTALL=1
The host’s build cannot fetch the theme The build environment has no Go Hugo Modules need Go. If the platform does not provide it, use a submodule or commit themes/oink/
CI output differs from local go.work took part in the CI build Set GOWORK: off and HUGO_MODULE_WORKSPACE: off in CI so it uses only the version pinned in go.mod
A preview deployment got indexed The preview was built in the production environment Drop --environment production from preview builds; a non-production build emits noindex and Disallow: /. See Analytics and SEO
macOS reports too many open files Live preview watches more files than the shell limit allows Exclude generated and irrelevant directories from the watch first, since they are the usual cause; raise ulimit -n only if that is not enough
Slow, or missed changes, under WSL The site sits on a Windows mount point Keep the site inside the Linux filesystem; change notifications and permissions across filesystems break live reload
Bootstrap / Font Awesome / Mermaid assets are missing An incomplete copy of the theme Do not substitute a CDN URL. Confirm that assets/third_party/, static/webfonts/ and VENDOR.json are present, and download the same pinned release again if anything is missing

Checks a site can run

Run the build on every change. The two scripts come from a checkout of the theme repository at the release your site pins, shown as /path/to/oink, and need only Python 3; replace the site path and base URL with your own.

A production build , Commandhugo --printPathWarnings
Duplicate output paths, invalid parameters, incomplete external integrations
Output trust check , Commandpython3 /path/to/oink/bin/check-output-security.py --public /path/to/my-site/public --base-url https://my-site.example/
Every href / src in all four outputs is site-relative or uses http(s) / mailto / tel; no javascript: URLs or inline on* handlers; a cross-site <iframe>, <script> or <img> needs an explicit --third-party. Details in Verifying an offline build
Book anchors , Commandpython3 /path/to/oink/bin/check-book.py --site-public /path/to/my-site/public
For a site with a book: every cross-reference target exists, kind and number agree, and IDs are unique within each page

Read the build’s warnings: each one names the key, the rejected value and the default the theme used instead, and When a value is wrong explains why OINK warns rather than failing the build.

Diagnostic habits

When no row matches:

  • Reproduce the problem with one known Hugo version and record its hugo version output, so the version cannot change between runs.
  • Compare the development and production configuration; a problem that appears only online is often an environment difference.
  • Separate theme behavior from a site override with a minimal page. Put the suspect content on a page of its own, then re-enable site overrides in batches until one batch brings the problem back.
  • Look at the failing page’s browser console and network panel, especially the paths of any 404 resources.

Getting help

When you open an issue, include the complete hugo version output, the theme version from hugo mod graph | grep oink, the first complete error, and a minimal page or site that reproduces it. With those four, nobody has to ask you for more details first.

  • Local preview — clean builds, clearing caches, containers and workspaces
  • Deploy — baseURL, the checklist and rollback
  • Upgrade — problems an upgrade introduces, and the migration toolkit
  • Search — index scope, ranking and Algolia
  • Languages — language configuration and the anchor alignment process