A Markdown version for every page: putting rel=alternate and describedby in place
How to implement the proposal’s companion suggestion: the .md path rules, the index.md form for URLs without a file name, rel=alternate and rel=describedby in HTML and in HTTP headers, and configuration samples for three servers.
About 3 min read
llms.txt only solves the “index entry point”. The proposal comes with a companion suggestion: provide a clean Markdown version of every page, so that an agent reading the body does not have to parse HTML. This guide is the implementation checklist.
Path rules
- Pages with a file name: append
.mdto the original URL (page.html→page.html.md) or replace the extension (page.html→page.md). The proposal accepts both forms; pick one for the whole site and stick to it. - URLs without a file name (
/docs/guide/): provide theindex.mdorindex.html.mdform (the same naming rule as directory index files).
Two link relations
rel="alternate" type="text/markdown": points from the HTML page to its Markdown version.rel="describedby": points from the page to the llms.txt that covers it (for the scope rules see subpath scopes).
Either carrier works: an HTML <link> element, or an HTTP Link: response header.
Configuration samples
<!-- HTML head: alternate + describedby -->
<link rel="alternate" type="text/markdown" href="/docs/guide.md" />
<link rel="describedby" type="text/plain" href="/docs/llms.txt" />
# Nginx: serve index.md for the directory-style URL /docs/guide/, with the header
location = /docs/guide/ {
add_header Link '</docs/guide/index.md>; rel="alternate"; type="text/markdown", </docs/llms.txt>; rel="describedby"';
try_files /docs/guide/index.html =404;
}
# Caddy: serve .md directly + header
respond /docs/guide/index.md 200
header /docs/guide/* Link "</docs/guide/index.md>; rel=\"alternate\"; type=\"text/markdown\", </docs/llms.txt>; rel=\"describedby\""
// Next.js (app router): a route segment that outputs md + header
// app/docs/guide/md/route.ts
export async function GET() {
const md = await loadGuideMarkdown("guide");
return new Response(md, {
headers: {
"content-type": "text/markdown; charset=utf-8",
link: '</docs/llms.txt>; rel="describedby"',
},
});
}
Content discipline for the Markdown version
- Keep only the body: remove navigation, footers, scripts and ad slots.
- Keep the heading levels and the links (links are how an agent moves on).
- Update it together with the HTML version: a stale .md is worse than no .md.
Test environment and results
Environment: Node v24.18.0 / Caddy 2 / nginx 1.27 documentation check, 2026-10-07. The Caddy and Next forms above use the same stack as this site’s deployment (this site is a Caddy reverse proxy plus Next.js). The comma-separated multi-value form of the Link: header was tested locally on Caddy and can be read by curl (2026-10-07). The wording in the proposal is that of a suggestion or convention: whether an agent consumes it depends on each agent’s implementation.