Skip to content

feat(docs): AI-friendly docs — markdown twins, llms.txt, copy page button, upgraded search#739

Merged
binaryk merged 1 commit into
10.xfrom
feat/docs-ai-friendly
Jul 7, 2026
Merged

feat(docs): AI-friendly docs — markdown twins, llms.txt, copy page button, upgraded search#739
binaryk merged 1 commit into
10.xfrom
feat/docs-ai-friendly

Conversation

@binaryk

@binaryk binaryk commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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)

  • Every docs page now has a raw-markdown twin at its URL + .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 .md links.
  • /docs/llms-full.txt — all pages concatenated for one-shot LLM context.
  • /llms.txt at the site root per the llmstxt.org convention.
  • Generated by scripts/generate-llms.mjs, wired into nuxt generate via the nitro:build:public-assets hook, so it works on the Cloudflare Pages static deploy with no runtime server.
  • _headers serves .md/llms files with markdown content types; /docs/* is wildcard-excluded in _routes.json to stay under Cloudflare Pages' 100-rule limit.

Copy page button (Forge-style)

  • Split button on every docs page: Copy page copies the page as markdown to the clipboard; the dropdown adds View as Markdown, Open in ChatGPT, and Open in Claude with a pre-filled prompt pointing at the page's .md URL.
  • Graceful dev-mode fallback when the static .md twin doesn't exist.

Search upgrade

  • The search modal was effectively exact-match only (Fuse threshold 0.1). Now: fuzzy, section-level full-text search (headings + body), grouped results, and an AI hint in the modal footer (append .md to any docs URL / /docs/llms.txt).

Test plan

  • npm run build (nuxt generate, cloudflare_pages preset) passes
  • 32 .md twins verified in dist/ with banner + title + description
  • dist/llms.txt, dist/docs/llms.txt, dist/docs/llms-full.txt well-formed
  • _routes.json at 29 rules (was at the 100 ceiling before the wildcard fix)
  • vue-tsc clean on changed components
  • Visual check of Copy page button + search on the Pages preview deploy

…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
@what-the-diff

what-the-diff Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR Summary

  • Enhanced Styling for Command Palette
    New styling has been implemented for search results in the command palette to make it more visually appealing and navigable.

  • Improved Search Functionality
    The search function in the main application now incorporates a footer with hints and helpful links. These additions provide a more user-friendly search experience.

  • Updated Search Button UI and Keyboard Shortcut
    The search button now boasts an updated UI label to improve clarity, and includes a handy keyboard shortcut for improved accessibility and faster navigation.

  • Added Component for Page Content Copy
    A newly added component, the CopyPageDropdown, allows users to copy the content of a page as Markdown. This provides additional options and enhances the user experience.

  • Generation of Raw Markdown Twins and Documentation Files
    The configuration now allows for the generation of raw Markdown twins and llms.txt files, improving the process of constructing documentation.

  • Conditional Display of CopyPageDropdown on Documentation Pages
    The page rendering logic has been enhanced to conditionally display the CopyPageDropdown on documentation pages. This improves the usability of documentation pages.

  • Serving Markdown Files with Correct Content Type
    HTTP headers have been added to ensure that Markdown files are served with the correct content type.

  • Automated Generation of Markdown Exports at Build Time
    A script has been added that generates Markdown exports and indexes automatically at build time, improving the efficiency of the development process.

@binaryk binaryk merged commit e4b6d97 into 10.x Jul 7, 2026
33 of 34 checks passed
binaryk added a commit that referenced this pull request Jul 11, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant