feat: integrate vitepress-plugin-llms for llms.txt generation#266
feat: integrate vitepress-plugin-llms for llms.txt generation#266sriramveeraghanta wants to merge 1 commit intomasterfrom
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe changes replace a custom build-end hook that manually copied markdown files into the output directory with an integrated VitePress plugin ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/.vitepress/config.mts (1)
63-63: Consider passing plugin options for richerllms.txtoutput.Invoking
llmstxt()with no options works, but the generatedllms.txt/llms-full.txtwill use defaults (relative links, sitetitle/descriptioninferred from VitePress config). For LLM consumers fetching by URL, configuring at minimum adomainso emitted links are absolute — plus a tailoredtitle/descriptionand optionalignoreFilesto exclude pages you don't want indexed (e.g., stub/landing content) — typically produces a more useful index. This also partially mitigates the known tradeoff thatdocs/index.md(layout: home) is skipped, since you can provide a custom description/intro via the plugin rather than relying on the home page.♻️ Example
- plugins: [llmstxt()], + plugins: [ + llmstxt({ + domain: "https://developers.plane.so", + title: "Plane developer documentation", + description: + "Self-host Plane, integrate with our API, configure webhooks, and extend your project management platform.", + }), + ],🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/.vitepress/config.mts` at line 63, The plugin is instantiated with default options causing emitted llms.txt/llms-full.txt to contain relative links and inferred metadata; update the llmstxt() call in the VitePress config to pass explicit options (e.g., domain to force absolute URLs, title and description for a custom intro, and ignoreFiles to exclude pages) so the generated index is richer and usable by LLM consumers; locate the llmstxt(...) entry in the plugins array and replace it with a configured call like llmstxt({ domain: 'https://your.site', title: 'Your Docs Title', description: 'Custom intro/summary', ignoreFiles: ['path/to/stub.md', ...] }) adjusting values for your site.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/.vitepress/config.mts`:
- Line 63: The plugin is instantiated with default options causing emitted
llms.txt/llms-full.txt to contain relative links and inferred metadata; update
the llmstxt() call in the VitePress config to pass explicit options (e.g.,
domain to force absolute URLs, title and description for a custom intro, and
ignoreFiles to exclude pages) so the generated index is richer and usable by LLM
consumers; locate the llmstxt(...) entry in the plugins array and replace it
with a configured call like llmstxt({ domain: 'https://your.site', title: 'Your
Docs Title', description: 'Custom intro/summary', ignoreFiles:
['path/to/stub.md', ...] }) adjusting values for your site.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b7a07ee0-3eb2-40df-9da3-e092ab98dc7a
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
docs/.vitepress/config.mtspackage.json
Summary
vitepress-plugin-llmswhich generatesllms.txt(index, ~67 KB) andllms-full.txt(~1.4 MB) indist/on build, plus cleaned per-page markdown.buildEndwalk introduced in feat: agent discovery (Link headers, markdown negotiation, Content-Signal) #263 that copied raw source.mdintodist/. Agents hitting/path.mdviaAccept: text/markdownnow get LLM-friendly output (nolayout:frontmatter, no Vue component markup).docs/index.md,layout: home) is skipped by the plugin, so/→ markdown no longer has a direct equivalent.llms.txtserves as the LLM-oriented index instead.Test plan
pnpm buildsucceedsdist/llms.txtanddist/llms-full.txtgenerated.mdfiles indist/are plugin-cleaned (verifiedself-hosting/overview.md)pnpm check:formatpassesAccept: text/markdownand confirm cleaned markdown is served/llms.txtand/llms-full.txtare reachable on the deployed previewSummary by CodeRabbit