This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Hugo documentation website for Cozystack (Kubernetes-based cloud platform) using the Google Docsy theme. Production is served by GitHub Pages. Netlify is only used for deploy previews on PRs. Do not rely on Netlify-specific redirects or headers for production behavior. The stable /docs/ and /docs/v<major>/ paths are real copies of the latest version, produced after hugo by hack/mirror_latest.sh (Python 3 standard library). Current numbered docs and both copies use canonical URLs under /docs/. Older numbered docs remain noindex and are excluded from sitemaps. Preview builds are noindex. The version-selection landing is copied to /docs/versions/; mirroring preserves numbered versions and unrelated legacy aliases. The .docs-mirror.json file tracks root and major copies for cleanup on repeat builds. Under hugo server, version-selection links use the existing /docs/ landing.
# Install dependencies
npm install
# Local dev server (serves at http://localhost:1313/docs; wipes public/ first)
make serve
# Production build
./hack/download_openapi.sh && hugo --gc --minify && ./hack/mirror_latest.sh
# Sync app docs from cozystack/cozystack repo.
# By default targets content/en/docs/next/ (the version-agnostic trunk).
# With RELEASE_TAG, routing depends on whether the minor version is already released:
# - patch of an existing released version → updates that vX.Y/ in place
# - otherwise → updates next/ (upcoming release)
make update-all # update trunk from upstream main
make update-all RELEASE_TAG=v1.2.5 # patch release → updates v1.2/
make update-all RELEASE_TAG=v1.3.0 # v1.3 not yet released → still updates next/
make update-apps # application docs only (also: update-vms, update-networking, update-k8s, update-services)
make update-oss-health # OSS health metrics (requires Python 3.12+)
# Scaffold front-matter-only stubs into DEST/_include (scaffolding variant of update-*, via hack/fill_templates.sh)
make template-all # or template-apps / template-vms / template-networking / template-k8s / template-services
# Version lifecycle (requires yq v4+)
make init-next # (re)create content/en/docs/next/ from latest released version
make release-next RELEASE_TAG=v1.3.0 # promote next/ → v1.3/, register in hugo.yaml
# Initialize a new docs version directory directly (edge cases / manual backfills)
make init-version DOC_VERSION=v1.3
# Override the app list for any update-*/template-* target
make update-apps APPS="tenant redis"
# Debug routing
make show-target RELEASE_TAG=v1.3.0 # prints the resolved DOC_VERSION/BRANCHRequired tools: Hugo extended v0.164.0, Go 1.23+, Node 22+, yq v4+ (for version lifecycle targets), jq (for hack/download_openapi.sh in the production build and make update-all without RELEASE_TAG).
- Hugo modules (not git submodules): Docsy theme v0.12.0 pulled via
go.mod - Versioned docs:
content/en/docs/v0/,content/en/docs/v1.0/,content/en/docs/v1.1/,content/en/docs/v1.2/plus the permanent trunkcontent/en/docs/next/. Version switching handled bylayouts/partials/version-switcher.html(honours thehidden: trueflag on version entries). Version derived from RELEASE_TAG (e.g., v1.2.1 → v1.2) - Content sync scripts:
hack/update_apps.shfetches READMEs from the upstream cozystack repo and appends autogenerated notices. Driven by themake update-*targets (manual) - OpenAPI specs: v0/v1.0 api.json stored in git; v1.1+ downloaded at build time from GitHub releases via
hack/download_openapi.sh - OSS health pipeline:
hack/update_oss_health.pycollects metrics from GitHub API, OpenSSF, DevStats, OSS Insight → writes JSON todata/oss-health/andstatic/oss-health-data/. Monthly GitHub Action - Asset pipeline: Bootstrap 5.3 + Font Awesome 6.7 mounted from node_modules via Hugo mounts (configured in
hugo.yaml). SCSS entry point:assets/scss/main.scss - Blog:
content/en/blog/with permalink pattern:section/:year/:month/:slug/
Docs are versioned per Cozystack minor release. Each version is an independent copy of the tree under content/en/docs/<version>/ and is built into its own URL prefix (/docs/<version>/).
Directory layout
- One directory per minor version:
content/en/docs/v0/,v1.0/,v1.1/,v1.2/ - Version name derivation: major
0→v0(legacy, covers all 0.x); major ≥ 1 →v<major>.<minor>(e.g.,v1.2). Patch level is not reflected in the directory name - Each version directory is self-contained: all pages under
applications/,virtualization/,networking/,operations/,storage/,install/,guides/, etc. live once per version content/en/docs/_index.mdis the version-selection landing, published at/docs/versions/after mirroringcontent/en/docs/next/is the permanent trunk for upcoming/unreleased docs. Internal links use/docs/next/; these are rewritten at release time byhack/release_next.sh. Excluded from production builds via thehidden: trueentry inhugo.yamland the content mount exclusion- '! docs/next/**'
Version registration (hugo.yaml)
params.latest_version_id— id of the current/default versionparams.versions[]— ordered list consumed by the version switcher (layouts/partials/version-switcher.html). Newest goes first,orderhighest. When adding a new version, update both fields.params.versions_visible— how many of the newest non-hidden versions (ranked byorder, minimum 1) stay in the switcher, the version table and the sidebar tree on the version-selection page (/docs/versions/); the rest are grouped under "Older versions".hack/register_version.shneeds no change: a new release pushes the oldest visible version into the group on its own. The split lives inlayouts/partials/docs-versions.html.hidden: trueon a version entry hides it from the dropdown selector. Combined with the content mount exclusion pattern (- '! docs/<id>/**'), the whole version is also excluded from production builds. Used for thenexttrunk; the dev server and Netlify deploy previews still render it at/docs/next/.
Where to add changes
- Docs for an upcoming (unreleased) feature → edit
content/en/docs/next/. These materialize asv<next-release>/whenmake release-next RELEASE_TAG=vX.Y.Zruns - Bug fix or addition to the current release → edit only
content/en/docs/<latest_version_id>/(theparams.latest_version_idvalue inhugo.yaml) - Content that also applies to older supported versions → copy the change into each relevant
v*/directory (no automatic backport) - Cross-version/landing content →
content/en/docs/_index.md - Blog posts are version-independent →
content/en/blog/
Autogenerated files — do not edit in-place
- App/VM/networking/services pages synced from
cozystack/cozystackhave the footerAutogenerated content. Don't edit this file directly; edit sources instead.(injected byhack/update_apps.sh) - To change the body: edit the upstream README in
cozystack/cozystackunderpackages/apps/<app>/(orpackages/extra/<svc>/for services), then re-run the correspondingmake update-*target - To change only front matter (title, weight, aliases) for a specific version: edit the stub at
content/en/docs/<version>/<section>/_include/<app>.md—update-*merges this with the upstream README.make template-*scaffolds these stubs
RELEASE_TAG → routing (Makefile)
The Makefile routes updates between next/ and released vX.Y/ directories. Given a RELEASE_TAG like v1.2.5 the minor version v1.2 is derived; routing is:
make update-all(no tag) →DOC_VERSION=next,BRANCH=mainmake update-all RELEASE_TAG=v1.2.5andcontent/en/docs/v1.2/exists and is a non-hidden entry inhugo.yaml→DOC_VERSION=v1.2(patch release, updates in place)make update-all RELEASE_TAG=v1.3.0andcontent/en/docs/v1.3/does not yet exist →DOC_VERSION=next(still accumulating in the trunk)make release-next RELEASE_TAG=v1.3.0copiescontent/en/docs/next/→content/en/docs/v1.3/, rewrites/docs/next/links, and registersv1.3viahack/register_version.sh --release v1.3.next/is unchanged- After
release-next, subsequentmake update-all RELEASE_TAG=v1.3.1routes tov1.3/
Releasing a new minor (v1.3.0)
make release-next RELEASE_TAG=v1.3.0— copiesnext/→v1.3/, rewrites internal links, registersv1.3as the newlatest_version_id.next/stays in place for the next cycle- (optional)
make update-all RELEASE_TAG=v1.3.0— pulls fresh upstream READMEs pinned to the exact tag intov1.3/
Refreshing the trunk from the latest released version
make init-next— removescontent/en/docs/next/and reinitializes it from the latestv*/directory.hack/init_version.shhandles thenext/case specially (sets title to "Cozystack Next (unreleased)", strips aliases, prepends a draft banner shortcode)
OpenAPI per version
v0andv1.0ship theirapi.jsonin git understatic/docs/<version>/cozystack-api/api.jsonv1.1+are fetched at build time fromhttps://github.com/cozystack/cozystack/releases/download/<tag>/openapi.jsonbyhack/download_openapi.sh(run beforehugo --gc --minify).openapi.jsonis produced as a release asset by the upstream tags workflow (cozystack/cozystack#2214)
How new-version docs arrive
- Docs updates are pushed by the upstream
cozystack/cozystackrelease workflow (.github/workflows/tags.yaml,update-website-docsjob). On everyvX.Y.Ztag it checks out this repo atmainand opens/updates a PR titled[docs] Update managed apps reference for v<version> - Upstream workflow contract:
- Always calls
make update-all RELEASE_TAG=vX.Y.Z— routing (above) picks the right target directory - Additionally calls
make release-next RELEASE_TAG=vX.Y.Zfor new minor/major releases (not patch releases).release-nextvalidates preconditions and fails hard if they aren't met — there is no silent no-op. Detection of "new minor vs patch" is owned by the upstream workflow (explicit conditional), not by the website-side Makefile
- Always calls
- The website-side
make update-*/make template-*/make release-next/make init-nexttargets andhack/update_apps.sh/hack/fill_templates.sh/hack/download_openapi.sh/hack/release_next.share the contract this upstream workflow invokes - The previous website-side daily cron (
.github/workflows/update-managed-apps.yaml) is obsolete (superseded by the upstream flow from cozystack/cozystack#2214)
hugo.yaml— main Hugo config including module mounts, menus, params, multi-version setupnetlify.toml— Netlify build settings (deploy previews include--buildFuture)package.json— npm deps (Bootstrap, Font Awesome, PostCSS/autoprefixer)
Located in layouts/shortcodes/: tabs/tab, note, warning, caution, include, youtube, system-resource-calculator, blocks/hero, blocks/resource, blocks/flux_ui_galleries.
- Docs synced from upstream have autogenerated notices — don't manually edit those files; update the source in cozystack/cozystack instead
- Hugo frontmatter uses YAML
- OSS health app pages use custom layout (
layouts/_default/oss-health-app.html) with frontmatter keys:oss_health_key,oss_health_kind,lede,source_url - Goldmark rendering has
unsafe: trueenabled (raw HTML allowed in markdown)