continue-custom/docs-site/lib/resolveHref.ts
Nate 606fba91a3 feat: add docs site as static Next.js export
Migrates the docs site from remote-config-server to this repo as a
standalone static Next.js app. Key changes:

- Copy app-docs from remote-config-server to docs-site/
- Configure `output: 'export'` for static HTML generation
- Replace API routes with build-time scripts (search index, image copy)
- Add generateStaticParams() to enumerate all doc slugs at build time
- Convert server-side redirects to client-side redirects
- Point DOCS_DIR to sibling ../docs directory
- Add GitHub Actions workflow for deploying to GitHub Pages
- Add missing Radix UI dependencies (accordion, tabs) to package.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 13:52:25 -07:00

19 lines
685 B
TypeScript

/**
* Resolve internal paths for the standalone docs app.
*
* On the docs subdomain, /docs/X becomes /X (we're already on docs.continue.dev).
* Cross-app links get absolute URLs.
*/
export function resolveHref(path: string): string {
// Strip /docs prefix — we're already on the docs domain
if (path.startsWith("/docs/")) return path.slice(5);
if (path === "/docs") return "/";
// Cross-app links → absolute URLs
if (path.startsWith("/blog")) return `https://blog.continue.dev${path.slice(5) || ""}`;
if (path === "/login") return "https://continue.dev/login";
if (path === "/") return "https://continue.dev";
// Everything else stays as-is
return path;
}