Standalone Astro documentation site for the impeccable command surface.
This repository does not run the upstream pbakaus/impeccable site directly. Instead, it pins the upstream repository as a vendor submodule, normalizes the upstream command catalog at build time, and renders localized HagiCode-owned docs content from this repository.
- Vendor source:
vendor/impeccable - Upstream command markdown reference:
vendor/impeccable/site/content/skills/ - Upstream category and relationship data:
vendor/impeccable/site/data/sub-pages-data.ts - Upstream command metadata:
vendor/impeccable/skill/scripts/command-metadata.json - Localized command body content:
src/content/commands/<locale>/*.mdxfor all 29 supported locale codes. - Localized overview entries:
src/content/docs/index.mdxand the Chinese variants undersrc/content/docs/; the Astro content loader supplies the existing fallback locales without copying command bodies. - Starlight locale and sidebar configuration:
src/lib/starlight/config.ts, projected from the generated command catalog. - HagiLight Starlight owns documentation RSS and publishes content-aware root and locale feeds. The plain-Astro discovery integration defers to Starlight so it cannot replace those feeds with empty defaults.
/en-US/and/en-US/docs/*remain redirect aliases, generated after the Astro build so they do not collide with Starlight's unprefixed default locale routes.- Shared UI locale source of truth:
src/i18n/locales/en-US/*.ymlsrc/i18n/locales/zh-CN/*.yml
- Starlight UI overrides for Simplified and Traditional Chinese:
src/content/i18n/.
git submodule update --init --recursive
cd repos/impeccable-site
env -u NPM_CONFIG_PREFIX npm installIf the submodule is already present but stale, update it with:
cd repos/impeccable-site
git submodule update --remote vendor/impeccableReview the upstream pointer change, then regenerate derived assets before committing.
From repos/impeccable-site:
env -u NPM_CONFIG_PREFIX npm run dev
env -u NPM_CONFIG_PREFIX npm run typecheck
env -u NPM_CONFIG_PREFIX npm test
env -u NPM_CONFIG_PREFIX npm run build
env -u NPM_CONFIG_PREFIX npm run validatevalidate runs the full local gate: hagi18n checks, catalog parity, Astro typecheck, tests, and static build.
Site-specific entry and overview/detail copy remains in YAML:
src/i18n/locales/en-US/common.ymlsrc/i18n/locales/en-US/docs.ymlsrc/i18n/locales/zh-CN/common.ymlsrc/i18n/locales/zh-CN/docs.yml
Starlight supplies its own translated shell labels. This site overrides the navigation, search, and not-found labels for Simplified and Traditional Chinese in src/content/i18n/; other configured locales use their Starlight translations or English fallback.
Generated runtime resources are written to src/i18n/generated-locales/ by:
env -u NPM_CONFIG_PREFIX npm run i18n:generateUseful maintenance commands:
env -u NPM_CONFIG_PREFIX npm run i18n:audit
env -u NPM_CONFIG_PREFIX npm run i18n:doctor
env -u NPM_CONFIG_PREFIX npm run i18n:sync
env -u NPM_CONFIG_PREFIX npm run i18n:sync:write
env -u NPM_CONFIG_PREFIX npm run i18n:prune
env -u NPM_CONFIG_PREFIX npm run i18n:prune:write
env -u NPM_CONFIG_PREFIX npm run i18n:checkEvery upstream command slug must exist in each of the 29 locale collections. The parity rules are enforced during catalog generation.
For English source-of-truth syncing, you can pull the upstream skill body content into the local en-US MDX files with:
env -u NPM_CONFIG_PREFIX npm run content:sync:vendorTo sync a single command only:
env -u NPM_CONFIG_PREFIX node scripts/sync-vendor-command-content.mjs --slug animateThis sync copies the upstream command body and tagline-driven summary into src/content/commands/en-US/*.mdx. Local frontmatter fields such as title, seoTitle, seoDescription, routeSlug, highlights, and related are preserved directly inside each MDX file so the site can keep its own presentation layer.
Add or update command docs in the relevant locale directories, for example:
src/content/commands/en-US/<slug>.mdxsrc/content/commands/zh-CN/<slug>.mdx
The filename and frontmatter slug must match the upstream slug exactly.
Regenerate the normalized catalog with:
env -u NPM_CONFIG_PREFIX npm run catalog:generateCheck that generated output is current with:
env -u NPM_CONFIG_PREFIX npm run catalog:checkThe generated catalog lives at src/lib/generated/command-catalog.json.
i18n:generateconverts YAML locale sources into JSON runtime resources.catalog:generatereads vendor metadata plus per-locale MDX frontmatter and emits a normalized command catalog.- The Starlight content loader projects the existing localized MDX and generated catalog route slugs to
/docs/<slug>/and/{locale}/docs/<slug>/; no vendor command bodies are copied into a second collection. - Starlight and the HagiLight adapter render the responsive docs shell and shared chrome as static HTML.
- The build emits the
/en-US/and/en-US/docs/*redirect aliases, then checks all 29 locale routes, metadata, navigation, and shared-only chrome.
Before committing, run:
env -u NPM_CONFIG_PREFIX npm run validateThis should confirm:
- Vendor paths are present.
- Every upstream command slug exists in all 29 locale directories.
- Generated locale resources are fresh.
- Generated command catalog is fresh.
- All canonical docs routes and
/en-US/aliases exist in static output. - Canonical/hreflang metadata, active/mobile navigation, language switching, the HagiLight footer/promotion, and generated RSS channel metadata and locale membership are checked in the built pages.
- Production command docs host:
https://impeccable.hagicode.com - Authoritative workflow:
.github/workflows/impeccable-site-deploy-gh-pages.yml - Production source of truth: the
gh-pagesbranch, published only by GitHub Actions - Published payload contract: branch root
esa.jsonc,wrangler.jsonc, anddist/containing the validated Astro snapshot - Build prerequisite in CI: the workflow checks out
vendor/impeccablerecursively before runningnpm run validate - Manual dispatch path:
workflow_dispatchrebuilds from the selected ref and republishes the validated payload togh-pages - Direct Cloudflare publication is handled outside this workflow; keep
gh-pages/wrangler.jsoncas the checked-in Wrangler contract for direct publish operations - Required GitHub permissions: the deploy job needs
contents: write; the build job stays read-only - Required hosting setting: configure the production host to read
gh-pages/esa.jsonc, treatgh-pages/wrangler.jsoncas the Wrangler source of truth for direct publication, and servegh-pages/dist/ - First deploy checks: confirm the workflow publishes
esa.jsonc,wrangler.jsonc, anddist/, verify the hosting target still points atgh-pages, and loadhttps://impeccable.hagicode.com - Rollback path: revert the source change or rerun deployment from an older commit so CI republishes the previous snapshot