sitemap.xml
Generate a sitemap from MDX pages and OpenAPI operations with the same model used by the documentation UI.
Loading documentation…
This is already configured in projects created with create-heyo-docs. No action is required if you used the creator to install Heyo Docs.
Heyo Docs generates /sitemap.xml from the documentation model. It includes
all MDX pages and generated OpenAPI operation routes, so the sitemap changes
with the content and navigation that readers see.
Set siteUrl before deployment so every <loc> uses the production origin:
Without it, the route uses the incoming request origin. That is useful locally or on a preview, but a production site should use one canonical address.
Heyo Docs publishes URLs only. It does not infer lastmod, priority, or
change frequency.
Build the model from the generated MDX pages and OpenAPI documents, then pass
its paths to sitemapXml(). The virtual modules are provided by the Heyo Docs
integration for React Router and Astro; the Next.js starter exposes the same
data through app/lib/docs.ts.
Register the resource route before the documentation catch-all:
Then create app/routes/sitemap.ts:
For a static React Router deployment, include /sitemap.xml in
prerender() in react-router.config.ts.
Create src/pages/sitemap.xml.ts:
Astro maps the file to /sitemap.xml; with static output, it is generated as
a build artifact.
Create app/sitemap.xml/route.ts:
docsModel must be built from the generated server-side page registry and
OpenAPI documents, as in the Next.js starter. This ensures generated operation
pages appear in the sitemap too.