docs: link v1 docs from header

This commit is contained in:
Dax Raad
2026-09-18 20:54:10 -04:00
Unverified
parent e1e2efe8ec
commit b38d72e174
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -1,6 +1,7 @@
import path from "node:path"
const root = path.resolve(import.meta.dir, "../dist/client")
const externalRoutes = new Set(["/docs"])
const files = await Array.fromAsync(new Bun.Glob("**/*.html").scan({ cwd: root, absolute: true }))
const failures = (
await Promise.all(
@@ -11,6 +12,7 @@ const failures = (
Array.from(html.matchAll(/href="([^"]+)"/g), async (match) => {
const url = new URL(match[1], page)
if (url.origin !== "https://opencode.local") return
if (externalRoutes.has(url.pathname)) return
const targetPath = path.join(root, decodeURIComponent(url.pathname))
const target = (
@@ -23,6 +23,7 @@ const searchEnabled = import.meta.env.PROD
</a>
))
}
<a href="/docs">V1</a>
</nav>
<div class="header-spacer"></div>
{