Skip to content

Commit 3159c41

Browse files
jaysin586claude
andcommitted
fix(llms): use ':' separator in llms.txt link entries
llmstxt.org specifies a link entry as `[name](url)` optionally followed by `:` and notes. The generated `## Documentation` and `## Examples` tables used an em dash instead. Conforming to the spec also makes the generated scaffolding pure ASCII. This does not make llms.txt ASCII-only overall -- prose from `description` and consumer markdown passes through untouched -- so sites must still serve the file as `text/plain; charset=utf-8` to avoid mojibake. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent df4405a commit 3159c41

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/lib/vite/llms.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,11 @@ async function buildIndex(opts: ResolvedOptions): Promise<string> {
293293
''
294294
)
295295
for (const e of entries) {
296-
// Format: `- [Title](mirror.md) — canonical HTML URL`
296+
// Format: `- [Title](mirror.md): canonical HTML URL`
297+
// The `:` separator is what llmstxt.org specifies for link notes.
297298
// Both URLs are useful — the .md is the citation surface, the
298299
// HTML URL is what the LLM should deep-link humans to.
299-
lines.push(`- [${e.title}](${opts.siteUrl}${e.route}.md) ${opts.siteUrl}${e.route}`)
300+
lines.push(`- [${e.title}](${opts.siteUrl}${e.route}.md): ${opts.siteUrl}${e.route}`)
300301
}
301302
if (exampleEntries.length > 0) {
302303
lines.push(
@@ -308,7 +309,7 @@ async function buildIndex(opts: ResolvedOptions): Promise<string> {
308309
''
309310
)
310311
for (const e of exampleEntries) {
311-
lines.push(`- [${e.title}](${opts.siteUrl}${e.route}.md) ${opts.siteUrl}${e.route}`)
312+
lines.push(`- [${e.title}](${opts.siteUrl}${e.route}.md): ${opts.siteUrl}${e.route}`)
312313
}
313314
}
314315
if (appendBody) {

0 commit comments

Comments
 (0)