See the contribution guidelines.
Merge requirements and workflow security analysis are project-wide (this repo's main ruleset mirrors Docsy's).
For the Renovate settings shared with Docsy and their rationale, the action-pin requirements, and the action-bump merge checks, see Docsy's Dependency updates. What differs here:
- The
gomodmanager is disabled; Docsy is updated manually. hugo-extendedtracks Docsy's version rather than the latest release; see Update Hugo.packages/hugoautogenis regenerated from the theme, reverting any direct Bootstrap or Font Awesome bump. If a security PR bumps them directly, route the fix through a Docsy update.- No audit test guards the action-pin comments here; the PR reviewer checks them.
The site deploys on Netlify: logs are in the project's Netlify dashboard and an alternate dashboard.
The lockfile (package-lock.json) and the generated theme-dependency manifest
(packages/hugoautogen/package.json) are committed so that installs are
reproducible: npm run install:safe (npm ci --ignore-scripts) installs
exactly what they pin.
Both files are regenerated by npm run update:docsy:pack, which, unlike
install:safe, needs go at run time (hugo mod); it also normalizes the
generated package's name, otherwise derived from the checkout-directory name.
The Docsy-update scripts and approve:hugo run it as their post phase, and CI
reruns it to catch drift. If a theme update changes either file, commit the
result. The manifests declare no lifecycle hooks (guarded by
tests/npm-scripts.test.mjs), so installs run no root-package code. A plain
npm install resolves and may rewrite the lock.
.npmrc follows Docsy's, with two exceptions:
- No
@docsy:registrypin: this repo publishes no packages. - No
ignore-scripts=true: theallowScriptscheck in Update Hugo runs only on an install that runs scripts, and this repo needs one to exist.- Here, CI's
npm ciis that install, and so is a plainnpm installunless a user-levelignore-scriptsis set; either runs hugo-extended's installer.npm run install:saferuns no scripts, so unlike in Docsy's flow it never fails on a missing approval. - Docsy can set the key because its
install:safere-enables scripts for hugo-extended alone, in a rebuild step (officially supported version), so its CI still evaluates the allowlist; this repo'sinstall:safehas no such step. - With the key set, a lock-synced hugo-extended bump with no approval would
arrive with a green
check-links. - The Netlify build is script-free (
install:safe) and then runshugo, whose wrapper self-installs the pinned binary: that path checks no approval here (Docsy's does, through its rebuild step).
- Here, CI's
Update Docsy to the latest tagged release:
npm run update:docsy:modOr update to the latest commit on the main branch:
npm run update:docsy:mainhugo-extended's installer downloads and executes a binary. Every pinned version
has a maintainer approval on record (allowScripts), and CI flags a bump
without one: npm ci fails (Install configuration
names the installs that run scripts). The approval covers the install script
only; the binary self-installs at first use regardless. The two-step flow that
keeps the approval current is Docsy's. What
differs here:
- The version tracks Docsy's officially supported version. If a security PR bumps it, take the fix through Docsy instead: once Docsy pins a version carrying it, update to that version with the command below, then approve.
- Update using
npm install --save-dev --save-exact --ignore-scripts [email protected]; this repo has noupdate:hugoscript. For a release younger than the npm cooldown, add Docsy'sNPM_CONFIG_MIN_RELEASE_AGEoverride to that command. npm run approve:hugohas no audit to re-run and no rebuild step; instead its tail regenerates the manifest (Lockfile and generated manifest), and thehugocall in that step self-installs the just-approved binary.
With Docsy in the sibling folder of this repo's root (as declared in the
docsy.work Hugo workspace file), prepend local to the npm script you
want to invoke, e.g.:
npm run local -- serveThe local prefix runs the script against the sibling Docsy, and the server
watches it, so theme edits hot-reload.
To diff each build against the last (the A/B diff step of Docsy's consumer-site
test procedure), keep the built site in a git repo and commit it after each
build with npm run _commit:public. Two layouts:
npm run make:publicmakespublic/itself a repo, inside the project; it needs no configuration.- Maintainers keep
publicas a symlink to a sibling repo,docsy-example.g, so that the primary clone and its task worktrees (wt/docsy-example/TASK, beside the clone) share one snapshot. Hugo's Node permission model rejects a symlink whose target isn't insecurity.node.permissions.allowRead, sohugo.yamllists the snapshot as seen from the clone (../docsy-example.g) and from a worktree (../../../docsy-example.g), plus.(the npm workspace link undernode_modules/@docsyresolves into the project and needs it). PostCSS, run for the RTL stylesheet, is the tool that trips the check. From a worktree, the entry is live whether or notpublicis a symlink; an entry whose path doesn't exist is inert. A snapshot kept elsewhere needs its own entry.
For the link cache (the committed link-cache.jsonc, its fields, and the
refresh, prune, and seed recipes), see Docsy's Link checking and the link
cache. What differs here:
- The cache and
lychee.tomlare at the repo root, and CI runs the check in.github/workflows/links.yaml. - No refresh workflow: a lapsed seed keeps serving until you prune by hand. Run
npm run link-cache -- -p 0(drops only lapsed entries;-p Nalso drops the N oldest withoutexpires), thennpm run fix:link-cacheto re-verify those URLs, and commit the cache.