Commit Graph
3 Commits
Author SHA1 Message Date
Hyu e458699b64 fix(docs): prefix base-path assets in the dev server
The dev server mounts the site at basePath "/docs/" but never runs the
prefixing that the production build performs in
scripts/finalize-base-path.mjs. Any asset referenced as a literal
root-absolute URL therefore 404s locally: icons configured in docs.json
(navigation pages[].icon) and the brand logo in press.config.tsx.

Markdown images are unaffected, because the asset pipeline rewrites
those itself ("/docs/public/..." in dev, "/docs/assets/<hash>..." in the
build), which is why broken icons and working screenshots appeared on
the same page.

Add a serve-only Vite middleware that rewrites the unprefixed forms to
the "/docs/..." mount point. The rule set deliberately mirrors
finalize-base-path.mjs exactly, so a URL that breaks locally also breaks
in production rather than being masked by the dev server.

Verified: 60 images across four pages in three locales load with no
broken requests (the guide page alone went from 17 broken to 0),
tsc --noEmit passes, and npm run build still succeeds with the static
suite at 31/31 and no changes to generated tracked files.
2026-09-29 15:47:55 +08:00
dadachann d553369332 feat: prepare docs for langbot.app subpath 2026-09-04 15:39:04 +00:00
dadachann 02773bae16 feat: migrate documentation to Fumapress 2026-09-04 10:51:00 +00:00