Repository navigation
Serve a Markdown twin of every docs page and post, linked from llms.txt - #202
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every docs page and blog post now has a Markdown twin at its path plus .md, built from the same collection entry the HTML page renders, so it cannot drift: /docs/ai/mcp.md, /blog/.md, and /docs.md listing every docs twin. Site-relative links inside a twin point at other twins or absolute URLs. Each HTML page links its twin with rel=alternate, and llms.txt, llms-full.txt and robots.txt point at the twins.
The site is static Astro on Vercel. Vercel cannot negotiate a static file by Accept, but its routing middleware can, and middleware.ts already runs for /subgraphs; it now answers a docs or blog request carrying Accept: text/markdown with the twin, Vary: Accept. vercel.json sets text/markdown on .md files. Neither was tried on Vercel: the middleware was driven locally with a stubbed fetch through ten cases.
A new build step fails if a sitemap docs or blog page lacks a twin or llms.txt links an HTML docs URL. It caught the sitemap listing /docs/book/index, a 404, fixed here. Not done: /agents has no twin (it is not Markdown), and the version line is still hand-written, though version-check already fails CI on it.
npm run build and astro check exit 0.
Part of nuthatch-org/nuthatch#2980.