Repository navigation
Commit 7339119
authored
fix(docs): scope the llms.txt .mdx rule so it cannot compose into a 404 (#214)
/llms.txt stated two rules -- append .mdx to a page URL, and every page is also published under a locale prefix -- over the same 79 bullets, with nothing scoping the first to English. Composing them is what a machine reader does with an llms.txt, and it yielded /zh-Hans/docs/quickstart.mdx, which 404s.
The .mdx rule now states its own scope and names the exclusion. The Other Languages section is unchanged: those page URLs resolve, and it is the only place the file says translations exist.
The comment above LANG in llms-full.txt/route.ts claimed locale text stays reachable through the .mdx rewrite. It does not: next.config.mjs rewrites /docs/:path*.mdx and no locale-prefixed form, and llms.mdx/docs/[[...slug]] calls source.getPage(slug) with no language argument. Corrected, with a note that this belief is what reached the served file.
Verified by composing the rules from the served body: rule 1 79/79 -> 200, rule 2 79/79 -> 200 per locale, cross composition 0/79. The same probe exits 1 against the pre-change body. llms-full.txt byte-identical; llms.txt differs in one line.
Closes #2101 parent 9a5a032 commit 7339119
2 files changed
Lines changed: 27 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
91 | 105 | | |
92 | 106 | | |
93 | 107 | | |
| |||
99 | 113 | | |
100 | 114 | | |
101 | 115 | | |
102 | | - | |
103 | | - | |
| 116 | + | |
| 117 | + | |
104 | 118 | | |
105 | | - | |
| 119 | + | |
| 120 | + | |
106 | 121 | | |
107 | 122 | | |
108 | 123 | | |
| |||
0 commit comments