Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/docs/content/docs/spec/llms-txt-extensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This section is novel to AEO and addresses a real failure mode: AI agents confla

### Markdown Twin URLs in llms.txt

A conformant `llms.txt` SHOULD link to HTML URLs (not `.md` URLs) in its Section lists. AI agents can discover the markdown twin via the [`Link rel="alternate"` header](./discovery.md#1-link-relalternate-header-required) on the HTML response.
A conformant `llms.txt` SHOULD link to HTML URLs (not `.md` URLs) in its Section lists. AI agents can discover the markdown twin via the [`Link rel="alternate"` header](/docs/spec/discovery#1-link-relalternate-header-required) on the HTML response.

This is intentional: HTML URLs are stable, link-shareable, and conform to user expectations. The markdown is an alternate representation, not a separate resource.

Expand Down
7 changes: 5 additions & 2 deletions apps/docs/scripts/sync-spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ for (const name of readdirSync(specDir)) {

let body = readFileSync(join(specDir, name), "utf8");

body = body.replace(/^# .+\n+/, "");
body = body.replace(/^# .+(?:\r?\n)+/, "");

body = body.replace(/\]\(\.\/([\w-]+)\.md\)/g, (_m, slug) => `](/docs/spec/${FILE_MAP[`${slug}.md`]?.slug ?? slug})`);
body = body.replace(
/\]\(\.\/([\w-]+)\.md(#[^)]+)?\)/g,
(_m, slug, hash = "") => `](/docs/spec/${FILE_MAP[`${slug}.md`]?.slug ?? slug}${hash})`,
);

body = body.replace(/\.\.\/packages\/([\w-]+)/g, (_m, pkg) => `/docs/packages/${pkg}`);
body = body.replace(/\.\.\/packages/g, "/docs/packages/core");
Expand Down