diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 6369b62..67b2a58 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,5 +1,5 @@ -import { readFileSync } from "fs"; -import { resolve } from "path"; +import { copyFileSync, mkdirSync, readFileSync, readdirSync, statSync } from "fs"; +import { dirname, join, relative, resolve } from "path"; import { defineConfig, type HeadConfig } from "vitepress"; import { tabsMarkdownPlugin } from "vitepress-plugin-tabs"; @@ -50,6 +50,30 @@ export default defineConfig({ description: "Modern project management software", cleanUrls: true, + buildEnd(siteConfig) { + // Copy source .md files into dist/ for Accept: text/markdown negotiation. + const srcDir = siteConfig.srcDir; + const outDir = siteConfig.outDir; + + function walk(dir: string): void { + for (const entry of readdirSync(dir)) { + if (entry === ".vitepress" || entry === "public" || entry === "node_modules") continue; + const abs = join(dir, entry); + const stat = statSync(abs); + if (stat.isDirectory()) { + walk(abs); + } else if (stat.isFile() && abs.endsWith(".md")) { + const rel = relative(srcDir, abs); + const dest = join(outDir, rel); + mkdirSync(dirname(dest), { recursive: true }); + copyFileSync(abs, dest); + } + } + } + + walk(srcDir); + }, + head: [ [ "link", diff --git a/docs/public/robots.txt b/docs/public/robots.txt index 48a9568..93a6510 100644 --- a/docs/public/robots.txt +++ b/docs/public/robots.txt @@ -6,4 +6,8 @@ Disallow: /core-concepts/issues.html Disallow: /core-concepts/projects/run-project Disallow: /importers/github-imp +# Content Signals — AI content usage preferences +# https://contentsignals.org/ +Content-Signal: search=yes, ai-train=yes, ai-input=yes + Sitemap: https://docs.plane.so/sitemap.xml diff --git a/vercel.json b/vercel.json index 281b5b4..eb392bf 100644 --- a/vercel.json +++ b/vercel.json @@ -1,6 +1,17 @@ { "cleanUrls": true, "trailingSlash": false, + "headers": [ + { + "source": "/(.*)", + "headers": [ + { + "key": "Link", + "value": "; rel=\"service-doc\"; type=\"text/html\", ; rel=\"sitemap\"; type=\"application/xml\"" + } + ] + } + ], "redirects": [ { "source": "/quick-start", @@ -262,5 +273,12 @@ "source": "/performance/hyper-mode", "destination": "/" } + ], + "rewrites": [ + { + "source": "/:path*", + "has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }], + "destination": "/:path*.md" + } ] }