feat(docs): AI-friendly docs — markdown twins, llms.txt, copy page button, upgraded search#739
Conversation
…pgraded search - Emit a raw-markdown twin for every docs page at <url>.md at build time - Generate /docs/llms.txt, /docs/llms-full.txt and root /llms.txt indexes - Add Forge-style Copy page split button (copy markdown, view as markdown, open in ChatGPT/Claude) on all docs pages - Tune docs search: fuzzy section-level full-text via Fuse options, AI hint in the search modal footer - Serve .md and llms files with markdown content types via _headers; wildcard-exclude /docs/* in Cloudflare Pages _routes.json to stay under the 100-rule limit
PR Summary
|
…ration 404s (#740) The Copy page split button shipped in #739 never rendered: it was wired into pages/[...slug].vue while all /docs/* routes are handled by the more specific pages/docs/[...slug].vue, and it was referenced as <CopyPageDropdown /> while the auto-import name is DocsCopyPageDropdown. - Render DocsCopyPageDropdown in the title row of pages/docs/[...slug].vue - Delete the root catch-all pages/[...slug].vue: it served no content (only /docs/** exists in the content collection) and its competing route caused client-side 404s after hydration on trailing-slash docs URLs - Drop the redundant nested <article> that caused hydration mismatches on every docs page - Fix doubled item descriptions in the copy dropdown (UDropdownMenu renders item.description natively) - Remove dead layouts/default.vue + TheHeader/TheSidebar/TheTableOfContents (unused since the docs layout took over) and add the ⌘K hint to the active search button Verified with a full static build + headless-browser checks: button in the title row in light/dark, 4-item dropdown with correct .md/ChatGPT/ Claude targets, fuzzy section-level search with the AI-tip footer, and no hydration 404s on slash/no-slash hard loads.
Makes the docs site AI/agent-friendly, modeled on the Laravel Forge (Mintlify) docs.
What's included
Raw markdown twins + llms.txt (build-time, fully static)
.md(e.g./docs/mcp/mcp.md), starting with a banner pointing agents at the docs index — 32 pages emitted./docs/llms.txt— index of all pages grouped by sidebar section with descriptions and absolute.mdlinks./docs/llms-full.txt— all pages concatenated for one-shot LLM context./llms.txtat the site root per the llmstxt.org convention.scripts/generate-llms.mjs, wired intonuxt generatevia thenitro:build:public-assetshook, so it works on the Cloudflare Pages static deploy with no runtime server._headersserves.md/llms files with markdown content types;/docs/*is wildcard-excluded in_routes.jsonto stay under Cloudflare Pages' 100-rule limit.Copy page button (Forge-style)
.mdURL..mdtwin doesn't exist.Search upgrade
.mdto any docs URL //docs/llms.txt).Test plan
npm run build(nuxt generate, cloudflare_pages preset) passes.mdtwins verified indist/with banner + title + descriptiondist/llms.txt,dist/docs/llms.txt,dist/docs/llms-full.txtwell-formed_routes.jsonat 29 rules (was at the 100 ceiling before the wildcard fix)vue-tscclean on changed components