Every collection’s pages are prerendered at build time unless you say otherwise. The rendering policy in the Nimbus config switches a collection to render on request instead, which needs a server.
Pick a mode
| Mode | Pages are rendered | Choose it when |
|---|---|---|
"build" (default) |
Once, during astro build |
The site is static, or builds are fast enough |
"request" |
When a reader requests them | Builds are slow, or you want Markdown at page URLs or a remote MCP server |
The policy covers the routes Nimbus serves collections from, and the Markdown and llms.txt routes that serve them. Your own files under src/pages/ keep their own prerender setting.
Prerequisites
- A host with an Astro server adapter: Cloudflare, Netlify, Node or Vercel
Steps
Add a server adapter
From the project root, install the adapter for your host:
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. The installer setsoutput: "server"and wires the adapter. On Cloudflare, it also addsrendering: { default: "request" }if the config has no policy yet.Set the policy
In
astro.config.ts, setrenderingin the Nimbus config.defaultapplies to the docs, their versions and API references;collectionssets a mode by collection name:astro.config.tsts const nimbusConfig = defineNimbusConfig({ // … rendering: { default: "request", collections: { archive: "build", }, }, });To keep the site prerendered except for one collection, flip it:
default: "build"with that collection set to"request".Build the site
npm run buildNimbus renders each route in the mode the policy sets, and warns when a route file says otherwise. Run
nimbus-docs check --fixto update the files: it sets each route’sprerenderline, keepsgetStaticPathson built routes only, and names the collection in a collection route’s page helper, such asgetCollectionPage(Astro, "sdk").add adapter-*and the scaffolder update them for you.
Verify
A request-rendered page has no HTML file in the build output. For a page at /guide/:
ls dist/client/guide/index.htmlls: dist/client/guide/index.html: No such file or directoryIf the file is there, the page’s collection is still set to "build": check the collection name in rendering.collections. Then deploy and load the page to confirm the server renders it.
What stays build output
Request rendering changes when HTML is made, not what’s discoverable. The sitemap, the search index, llms.txt, and each page’s Markdown version are still prepared during the build, so search and agents see every page.
Rules the build enforces
- Every name in
rendering.collectionsmust be a registered collection with its own catch-all route. An unknown name fails the build. defaultcoversdocs, version collections, API collections, and the site-widellms.txtandllms-full.txt; each collection’s Markdown and sectionllms.txtroutes follow that collection’s mode. Withoutrendering, every route Nimbus manages is built ahead of time, whatever itsprerenderline says. Oncerenderingis set, any other page collection with its own catch-all route, such as ablog, must be listed incollections.- A built route with a dynamic segment, such as
[...slug].astro, must exportgetStaticPaths. Astro can’t build it otherwise, so the build fails and names the file. - Generated API references render on request only on Cloudflare, except one with
bundle: false, which also works on Node. On other adapters, keep API collections set to"build". See Large APIs for large APIs and many versions.
Next steps
- Deploy to Cloudflare or other hosts: ship the server.
- Serve Markdown at page URLs: a feature request rendering unlocks.
- Configuration: every
renderingfield.