Publishing the docs site
How /guide and /api on https://neo-trixs.github.io get updated. Two repos, one rule: the homepage is code, the docs are output. This page is the manual pipeline on purpose — nothing here runs by itself.
| Repo | Holds | Changes how |
|---|---|---|
neo-trixs/NeoTrix | docs/ — the VitePress source (markdown, config.ts) | normal commits |
neo-trixs/neo-trixs.github.io | the published pages (guide/, api/, assets/, index.html) | this page's steps |
What is generated and what is hand-built
- Generated (never edit by hand in the site repo):
guide/*.html,api/*.html,assets/*(hashed chunks),hashmap.json,vp-icons.css,404.html,icons/, and thelogo*/hero.svg/background.svgcopies. - Hand-built (never overwritten by a docs build):
index.html(the star map),llms.txt,robots.txt,sitemap.xml,design/,tests/,tools/,vendor/.
If a docs build is copied wholesale, it replaces index.html with the VitePress home and the star map disappears. Sync the generated directories only.
Publish a docs change
# 1. source side — make the change and land it
cd <NeoTrix>
$EDITOR docs/4-GUIDES/getting-started.md
git commit -am "docs: …" && git push # (main is protected; land per repo rules)
SRC=$(git rev-parse --short HEAD)
# 2. build in a clean worktree so WIP elsewhere cannot leak in
git worktree add /tmp/nt-docs origin/main
cd /tmp/nt-docs/docs
npm install --no-audit --no-fund
npx vitepress build # → docs/.vitepress/dist
# 3. sync generated output into the site repo
cd <pages-repo>
D=/tmp/nt-docs/docs/.vitepress/dist
rsync -a --delete "$D/assets/" assets/
rsync -a --delete "$D/guide/" guide/
rsync -a --delete "$D/api/" api/
rsync -a --delete "$D/icons/" icons/
cp "$D/404.html" "$D/hashmap.json" "$D/vp-icons.css" \
"$D/logo-animated.svg" "$D/logo.svg" "$D/favicon.svg" \
"$D/hero.svg" "$D/background.svg" \
"$D/github-social-preview.png" "$D/github-social-preview.svg" .
# 4. gates, then publish
npm test
git add -A && git commit -m "docs(site): rebuild from NeoTrix@$SRC" && git push
# 5. tidy
cd <NeoTrix> && git worktree remove /tmp/nt-docsGitHub Pages redeploys in about 30–60 seconds. Verify the actual pages, not the build log:
curl -s -o /dev/null -w '%{http_code}\n' https://neo-trixs.github.io/guide/what-is-neotrix
curl -s https://neo-trixs.github.io/ | grep -c cap-grid # star map still therePre-flight checks
| Check | Why |
|---|---|
npm test in the site repo | duplicate ids, tag balance, required anchors, module syntax, i18n, search, wheel zoom, reduced-motion |
curl … | grep -c cap-grid after deploy | proves the sync did not overwrite the star map |
| grep the count you just changed | claims like the architecture-gate count appear in index.html, llms.txt and the built guide pages; a source-only edit leaves the site contradicting itself |
When numbers change
Numbers that appear on both sides of the split — gate count, test count, crate count, capability modules — live in three places and are not generated from one another:
docs/index.md+README.md(source, feeds/guide)index.htmlmeta / Open Graph / JSON-LD / footer (hand-built)llms.txt(hand-built, read by AI agents)
Change all three in the same session, then rebuild. A claim left behind on one side is the drift this project already paid for once.
The star map data
The 373 planets on the homepage come from .neo/capability_registry.json via tools/build_galaxy.py in the site repo:
python3 tools/build_galaxy.py <NeoTrix> galaxy.js
# paste the single `const GALAXY = …;` line into index.htmlEdit index.html directly and the page will disagree with the registry. Rebuild from the registry, then paste — do not hand-edit the data line.
What is deliberately not automated
An earlier revision ran a scheduled GitHub Action that rebuilt these pages daily. It was removed: it published without a human reading the diff, it needed cross-repo credentials to be useful for anything faster than daily, and it produced commits from machine-local asset hashing. The manual pipeline above replaced it. If the automation ever comes back, it must keep the star map out of its sync set and stop when the source commit has not moved.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Homepage turned into the VitePress landing | the whole dist/ was copied | restore index.html from git, re-sync only the listed paths |
Page Not Found on a guide URL | page not in config.ts sidebar/rewrites, or srcExclude | check docs/.vitepress/config.ts |
| Old styles after deploy | stale hashed assets | rsync --delete on assets/ (not a plain copy) |
EEXIST: symlink from npm test | node_modules/three symlink exists already | rm -rf node_modules/three and rerun |