From 894ed5bd88486ceb86062f021866ff167be267e2 Mon Sep 17 00:00:00 2001 From: afeez Date: Tue, 20 Oct 2026 12:56:42 +0100 Subject: [PATCH] fix(docs-site): rewrite relative links in local synced files #153 added a repo-relative link (docs/adr/0006-...md) to ROADMAP.md. The docs sync copies ROADMAP.md into the VitePress site verbatim, where that path has no page, so vitepress build failed its dead-link check and the docs deploy on main broke. Remote files already get their relative links rewritten to GitHub URLs; apply the same rewrite to local files. Co-Authored-By: Claude Opus 5.5 --- ROADMAP.md | 1 + docs/site/scripts/sync-docs.mjs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 69a1af1..10509cf 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -494,3 +494,4 @@ roadmap. See each phase section below for status and issue links. wire the remaining state changes. Tests: two new integration cases asserting the audit rows (the accept's two events, the decline's one) against the real `AuditEvent` table. +- 2026-10-20 — Docs site: `docs/site/scripts/sync-docs.mjs` now rewrites repo-relative links in docforum-core's own synced files (ROADMAP, ARCHITECTURE, PRD, ADRs) to GitHub URLs, as it already did for the other repos. #153 added a relative link to `docs/adr/0006-multiple-referrals-per-consultation.md` in ROADMAP.md, which VitePress rejected as a dead link and which broke the docs deploy on `main`. diff --git a/docs/site/scripts/sync-docs.mjs b/docs/site/scripts/sync-docs.mjs index 63f46be..3ab5f06 100644 --- a/docs/site/scripts/sync-docs.mjs +++ b/docs/site/scripts/sync-docs.mjs @@ -17,12 +17,14 @@ async function copyLocal(from, to) { const src = path.join(CORE_ROOT, from); const dest = path.join(SITE_ROOT, to); await mkdir(path.dirname(dest), { recursive: true }); - const content = await readFile(src, 'utf8'); + // Local files get the same rewrite as remote ones: a repo-relative link + // (e.g. ROADMAP.md -> docs/adr/0006-...md) has no page in the site. + const content = rewriteRelativeLinks(await readFile(src, 'utf8'), 'docforum-core'); await writeFile(dest, content); console.log(` synced (local) ${from} -> docs/site/${to}`); } -// Synced READMEs link relative to their own repo root (./ROADMAP.md, +// Synced files link relative to their own repo root (./ROADMAP.md, // docs/adr/foo.md, LICENSE, ...) — meaningless in the docs site's own // structure. Rewrite anything that isn't already absolute (http/https) // or a same-page anchor (#foo) to point at the real file on GitHub,