Every page already has a Markdown version at /<slug>/index.md. With Markdown negotiation, a request to the page’s own URL with Accept: text/markdown gets that Markdown too, so an agent doesn’t need to know the .md convention.
Prerequisites
siteset to your production origin in the Nimbus config- A host with a server adapter: Cloudflare, Netlify, Node or Vercel
Steps
Add a server adapter
Skip this step if the site already has one. For Cloudflare:
npx @cloudflare/nimbus-docs add adapter-cloudflareyarn nimbus-docs add adapter-cloudflarepnpm nimbus-docs add adapter-cloudflarebunx @cloudflare/nimbus-docs add adapter-cloudflareOther hosts use
adapter-netlify,adapter-nodeoradapter-vercel.Render the docs on request
In
astro.config.ts, set the docs collection to render on request:astro.config.tsts const nimbusConfig = defineNimbusConfig({ site: "https://docs.example.com", // … rendering: { collections: { docs: "request" } }, });Build and deploy
Deploy the server and the generated Markdown files together. Off Cloudflare, the server reads the Markdown from
site, so the files must be reachable there.
Verify
Request a page with Markdown first in the Accept header:
curl -I -H 'Accept: text/markdown' https://docs.example.com/guide/HTTP/2 200
content-type: text/markdown; charset=utf-8
vary: AcceptIf content-type is text/html, the page is still prerendered: check that its collection is set to "request". A browser’s Accept: */* always gets HTML.
Static sites
A prerendered page is served before any server code runs, so it can’t negotiate. On Cloudflare, turn on Markdown for Agents for the zone instead: Cloudflare converts the HTML when an agent asks for Markdown.
API references
Generated API references render on request only with the Cloudflare adapter. On other adapters, keep API collections set to "build" while the docs use "request".
Next steps
- Markdown and llms.txt: the
.mdversions this serves. - Override generated Markdown: change what a page’s Markdown contains.