.md endpoints
Serve every documentation page as clean, frontmatter-free Markdown for AI agents and other programmatic readers.
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 can expose every documentation page as public Markdown. For example,
/guides/installation is also available at /guides/installation.md; the
home page is available as /index.md. These endpoints return the generated,
frontmatter-free source with:
Markdown preserves headings, lists, links, and code examples without
navigation, search controls, or other rendered HTML. It is the preferred
retrieval surface for AI agents, especially when used with
llms.txt.
Use markdownForPage() with the generated page registry instead of maintaining
a second set of AI-facing files. That keeps the documentation UI, search index,
llms.txt, llms-full.txt, and Markdown endpoints on the same release.
The Markdown is public content. Do not put secrets, private runbooks, or browser-only instructions that should not be exposed in the configured content directory.
The public *.md URL needs different routing glue in each framework. All three
implementations return 404 Not Found for an unknown Markdown pathname rather
than falling through to the rendered documentation shell.
Register an internal resource route before the documentation catch-all:
Create app/routes/markdown.ts:
Finally, redirect a public *.md URL to that internal resource route from the
root middleware in app/root.tsx:
Create src/pages/[...slug].md.ts. getStaticPaths() emits one Markdown route
per known documentation page and maps the home page to index.md:
This is a static route in the Astro starter; rebuilding after an MDX change updates the matching Markdown file.
First add a beforeFiles rewrite in next.config.ts. It keeps the resource
route internal while preserving the public *.md URLs:
Then create app/heyo-docs-internal/markdown/[[...slug]]/route.ts:
The Next.js starter's markdownPages is its generated server-only registry.
Use the corresponding registry if your project stores it elsewhere.