feat(docs): publish a Markdown copy of every docs page - #79
Merged
Conversation
Nothing on the site enumerated its own pages: /sitemap.xml, /robots.txt and /llms.txt all returned 404. This adds all three, generated from the same Fumadocs source the site already builds from, plus the metadata that search engines and agents read first. - src/app/sitemap.ts: every docs page, blog post and hand-written route - src/app/robots.ts: allow all, pointing at the sitemap - src/app/llms.txt/route.ts: an llmstxt.org index built with fumadocs-core's llms helper, prefaced by a short section on what the site is for - src/app/layout.tsx: metadataBase, per-route canonical, Open Graph and Twitter cards, and Organization/WebSite/SoftwareApplication JSON-LD - src/app/not-found.tsx: recovery links, so a 404 is not a dead end - src/app/(home)/page.tsx: the "How it works" steps were h4 under an h2, so the heading hierarchy skipped a level New routes outside docs and blog need adding to STATIC_ROUTES in src/lib/site.ts to appear in the sitemap.
… title Follow-ups found by reading the first build's output: - blog posts canonicalised to a URL without the trailing slash the site actually serves, because the inherited relative canonical loses it on a catch-all route; set it explicitly instead - the home page title already began with "Apache Iggy", so the root template appended the brand a second time - llms.txt carried site-relative links and a second H1; links are now absolute and the generated index sits under an H2 - dropped the ASF postal address from the Organization JSON-LD: it was there only to satisfy an external scorecard, and the site does not otherwise publish it
JSON.stringify does not escape "<", so a value containing "</script>" would close the tag early. Every value in the payload is a constant today, but the escape makes that independent of what the object later carries.
An agent that wants a docs page currently has to parse the rendered HTML. This writes a Markdown copy next to each page at build time, so /docs/server/security/ is also available as /docs/server/security.md. The site is a static export served by ASF infrastructure, so it cannot do Accept-header content negotiation; a sibling file is the version of that which needs no server control. - scripts/generate-docs-markdown.mjs runs in prebuild, after the stars fetch, and rewrites public/**/*.md from content/docs on every build - generated files are gitignored, like src/github-stars.json - each docs page advertises its copy with <link rel="alternate" type="text/markdown">, and llms.txt states the .md convention The body is the MDX as authored, so custom components appear as tags. Rendering them out would need the MDX pipeline in this script; leaving them is honest about what the page contains and keeps the generator dependency-free.
kparisa
approved these changes
Sep 3, 2026
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.
An agent that wants a docs page has to parse the rendered HTML today. This writes a Markdown copy next to each page at build time, so
/docs/server/security/is also available as/docs/server/security.md.scripts/generate-docs-markdown.mjsruns inprebuildafter the stars fetch and rewrites the copies fromcontent/docson every build. Generated files are gitignored, likesrc/github-stars.json, so they can't drift from the source.<link rel="alternate" type="text/markdown">, andllms.txtstates the convention..mdfiles aren't in the sitemap. They're page alternates, not pages.npm run build, then: 76.mdfiles inout/, therel="alternate"andrel="canonical"links both present on a docs page,index.htmlcount unchanged, andgit statusclean.