Skip to content

Commit 079bad2

Browse files
feat: integrate vitepress-plugin-llms for llms.txt generation
Replaces the custom buildEnd walk that copied raw source .md into dist with vitepress-plugin-llms, which emits llms.txt, llms-full.txt, and per-page cleaned markdown. Agents hitting /path.md via Accept: text/markdown now get LLM-friendly output without frontmatter layout directives or Vue component markup.
1 parent 6757ff2 commit 079bad2

3 files changed

Lines changed: 710 additions & 25 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { defineConfig, type HeadConfig } from "vitepress";
22
import { tabsMarkdownPlugin } from "vitepress-plugin-tabs";
33
import { withMermaid } from "vitepress-plugin-mermaid";
4-
import { readFileSync, readdirSync, statSync, mkdirSync, copyFileSync } from "node:fs";
5-
import { resolve, join, relative, dirname } from "node:path";
4+
import llmstxt from "vitepress-plugin-llms";
5+
import { readFileSync } from "node:fs";
6+
import { resolve } from "node:path";
67

78
function loadEnvVar(key: string): string | undefined {
89
// process.env takes precedence (CI/hosting platforms set vars here)
@@ -59,6 +60,7 @@ export default withMermaid(
5960
// Mermaid configuration options
6061
},
6162
vite: {
63+
plugins: [llmstxt()],
6264
optimizeDeps: {
6365
include: [
6466
"lucide-vue-next",
@@ -75,29 +77,6 @@ export default withMermaid(
7577
],
7678
},
7779
},
78-
buildEnd(siteConfig) {
79-
// Copy source .md files into dist/ for Accept: text/markdown negotiation.
80-
const srcDir = siteConfig.srcDir;
81-
const outDir = siteConfig.outDir;
82-
83-
function walk(dir: string): void {
84-
for (const entry of readdirSync(dir)) {
85-
if (entry === ".vitepress" || entry === "public" || entry === "node_modules") continue;
86-
const abs = join(dir, entry);
87-
const stat = statSync(abs);
88-
if (stat.isDirectory()) {
89-
walk(abs);
90-
} else if (stat.isFile() && abs.endsWith(".md")) {
91-
const rel = relative(srcDir, abs);
92-
const dest = join(outDir, rel);
93-
mkdirSync(dirname(dest), { recursive: true });
94-
copyFileSync(abs, dest);
95-
}
96-
}
97-
}
98-
99-
walk(srcDir);
100-
},
10180
title: "Plane developer documentation",
10281
description:
10382
"Self-host Plane, integrate with our API, configure webhooks, and extend your project management platform. Complete guides for developers building on Plane.",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"prettier": "^3.8.1",
2626
"tailwindcss": "^4.1.18",
2727
"vitepress": "^1.6.4",
28+
"vitepress-plugin-llms": "^1.12.1",
2829
"vitepress-plugin-mermaid": "^2.0.17",
2930
"vitepress-plugin-tabs": "^0.7.3",
3031
"vue": "^3.5.26"

0 commit comments

Comments
 (0)