Skip to content

Commit 7da4cc2

Browse files
baozhoutaoclaude
andauthored
docs(apps/docs): fix stale docblock in page.tsx breadcrumb walk (#14537)
The census paragraph on origin/main still claimed "8 short trails remain" and that content/docs/releases/meta.json "still lists index" — both went false when PR #13946 removed "index" from that meta.json (0 hits repo-wide now under content/docs/**/meta.json). Rewrite it to the mechanism only (how a URL-less ancestor arises, that #12352/#13946 fixed every known instance, and that the condition is structural and can recur) rather than a count that rotted within a day. Also fixes an independent misattribution in the same paragraph: getBreadcrumbItems() does not drop the URL-less ancestor itself — it emits it with url: undefined. The drop is local, in docsTrail()'s own loop guard (`if (... || !item.url) continue;`). No behavior change: docsTrail(), the breadcrumb loop, and the "missing URL is deliberately not reconstructed" rule paragraph are untouched. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4a37870 commit 7da4cc2

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

  • apps/docs/app/[lang]/docs/[[...slug]]

apps/docs/app/[lang]/docs/[[...slug]]/page.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,17 @@ type DocPage = NonNullable<ReturnType<typeof source.getPage>>;
5555
* `index` node. ⛔ Nothing here splits `page.url` on `/`, and nothing constructs a
5656
* URL the loader has not already produced.
5757
*
58-
* ⚠️ **An ancestor can arrive without a URL, and this drops it.** Fumadocs
59-
* attaches a folder's `index.mdx` as that folder's `index` node only when the
60-
* folder's `meta.json` does **not** list `"index"` in `pages`; a folder that
61-
* lists it reaches this walk with a `name` and no `url`. That was once 17 of the
62-
* 35 `meta.json` files under `content/docs`, shortening 172 of 404 trails. 16 of
63-
* the 17 were fixed producer-side (#12352) and 8 short trails remain, all under
64-
* `content/docs/releases/` — a directory AGENTS.md fences off, so its `meta.json`
65-
* still lists `"index"`. The condition is therefore live, just rare.
58+
* ⚠️ **An ancestor can arrive without a URL, and the loop below drops it.**
59+
* `getBreadcrumbItems()` does not drop anything itself — it emits that
60+
* ancestor with a `name` and `url: undefined`. The drop happens locally, in
61+
* this file: the `if (typeof item.name !== 'string' || !item.url) continue;`
62+
* guard in the loop below skips it. Fumadocs attaches a folder's `index.mdx`
63+
* as that folder's `index` node only when the folder's `meta.json` does
64+
* **not** list `"index"` in `pages`; a folder that lists it reaches this walk
65+
* with a `name` and no `url`. #12352 and #13946 fixed every `meta.json` under
66+
* `content/docs` that did so — today's corpus has none — but the condition is
67+
* structural, not retired: any `meta.json` that lists `"index"` again
68+
* reproduces it.
6669
*
6770
* ⛔ The missing URL is deliberately **not** reconstructed here — that fence is
6871
* the reason #12352 was fixable at all. The folder's index page exists, is in the

0 commit comments

Comments
 (0)