Skip to content

Commit 1a5ba4f

Browse files
committed
docs(nav): stop listing "index" in meta.json pages — it detaches the folder index (#12352)
Fumadocs attaches a folder's index.mdx as that folder's tree `index` node only when the folder's meta.json does NOT list "index" in `pages`. Listing it makes the page an ordinary child and leaves the folder node with a name and no url, which degrades both surfaces built from that node: `getBreadcrumbItems()` drops the un-linkable ancestor, and the sidebar renders an inert `SidebarFolderTrigger` instead of a `SidebarFolderLink`. Removes "index" from 16 of the 17 meta.json files that listed it. content/docs/releases/ is fenced by AGENTS.md and is left untouched. Measured on the real fumadocs-core 16.14.4 loader over content/docs: short breadcrumb trails 172 -> 8 (the 8 are all under /docs/releases), and the sidebar delta is exactly 16 folder headers TRIGGER -> LINK plus 16 index children leaving the child list, with no other entry moved. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
1 parent 9057811 commit 1a5ba4f

18 files changed

Lines changed: 56 additions & 32 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
"@objectstack/docs": patch
3+
---
4+
5+
fix(docs): stop listing `"index"` in `meta.json` `pages` — it detaches the folder index and shortens 164 breadcrumb trails (#12352)
6+
7+
Fumadocs attaches a folder's `index.mdx` as that folder's tree `index` node
8+
**only when the folder's `meta.json` does not list it** in `pages`. Listing it
9+
makes the page an ordinary child instead, and the folder node reaches every tree
10+
consumer with a `name` and no `url``loader-*.js`, `buildFolder()`:
11+
12+
```js
13+
if (indexPath) {
14+
if (excludedPaths.has(indexPath)) delete node.index; // "index" was listed
15+
else excludedPaths.add(indexPath);
16+
}
17+
```
18+
19+
Two surfaces read that one node, and both were degraded:
20+
21+
- **Breadcrumb.** `getBreadcrumbItems()` links a folder crumb to `item.index?.url`,
22+
so an un-linkable ancestor is dropped rather than emitted name-only (Google
23+
requires `item` on every `BreadcrumbList` entry but the last). 172 of 404 doc
24+
pages advertised a two-level site structure they do not have.
25+
- **Sidebar.** `node.index ? SidebarFolderLink : SidebarFolderTrigger` — the
26+
section header was inert text, and the section's own overview page sat below it
27+
as a child, in six cases under a label identical to the header's.
28+
29+
`"index"` is removed from 16 of the 17 `meta.json` files that listed it. It was
30+
the first `pages` entry in 15 of them and the first entry after the
31+
`---Start Here---` separator in `getting-started`, so no other entry's position
32+
depends on it: the measured tree delta is exactly 16 folder headers going
33+
`TRIGGER``LINK` and 16 index children leaving the child list, with every
34+
removed child's URL now the header's `href` and no other line moved.
35+
36+
Short trails: **172 → 8**. The remaining 8 are `content/docs/releases/`, which
37+
this PR does not touch — that directory is fenced by AGENTS.md, and its
38+
`meta.json` still lists `"index"`.
39+
40+
No consumer-side change: `app/[lang]/docs/[[...slug]]/page.tsx` reconstructs no
41+
URLs, deliberately, so a producer defect of this shape stays visible.

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

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,21 @@ type DocPage = NonNullable<ReturnType<typeof source.getPage>>;
3939
* `index` node. ⛔ Nothing here splits `page.url` on `/`, and nothing constructs a
4040
* URL the loader has not already produced.
4141
*
42-
* ⚠️ **An ancestor arrives without a URL more often than not, and this drops it.**
43-
* Measured against a local production build, not inferred: fumadocs attaches a
44-
* folder's `index.mdx` as that folder's `index` node only when the folder's
45-
* `meta.json` does **not** list `"index"` in `pages`. 17 of the 35 `meta.json`
46-
* files under `content/docs` do list it, so their folder nodes carry a
47-
* `name` and no `url`, and 172 of 403 doc pages therefore ship a trail that skips
48-
* its section. Confirmed causally by deleting that one line from
49-
* `content/docs/data-modeling/meta.json` and rebuilding: the section crumb
50-
* appeared, linked, while an untouched control section stayed short.
42+
* ⚠️ **An ancestor can arrive without a URL, and this drops it.** Fumadocs
43+
* attaches a folder's `index.mdx` as that folder's `index` node only when the
44+
* folder's `meta.json` does **not** list `"index"` in `pages`; a folder that
45+
* lists it reaches this walk with a `name` and no `url`. That was once 17 of the
46+
* 35 `meta.json` files under `content/docs`, shortening 172 of 404 trails. 16 of
47+
* the 17 were fixed producer-side (#12352) and 8 short trails remain, all under
48+
* `content/docs/releases/` — a directory AGENTS.md fences off, so its `meta.json`
49+
* still lists `"index"`. The condition is therefore live, just rare.
5150
*
52-
* ⛔ The missing URL is deliberately **not** reconstructed here. The folder's index
53-
* page exists, is in the sitemap and answers 200 — the defect is in the content
54-
* config that hides it from the tree, not in this consumer, and a lookup that
55-
* re-derived it would make a producer bug invisible and permanent. Google requires
56-
* `item` on every crumb but the last, so a name-only crumb is not an option
57-
* either. Filed separately; when it lands, these trails complete with no change to
58-
* this file.
51+
* ⛔ The missing URL is deliberately **not** reconstructed here — that fence is
52+
* the reason #12352 was fixable at all. The folder's index page exists, is in the
53+
* sitemap and answers 200 — the defect is in the content config that hides it
54+
* from the tree, not in this consumer, and a lookup that re-derived it would make
55+
* a producer bug invisible and permanent. Google requires `item` on every crumb
56+
* but the last, so a name-only crumb is not an option either.
5957
*
6058
* Two things the tree cannot supply are added around it, both from data this
6159
* page already holds:

content/docs/ai/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"title": "AI",
33
"pages": [
4-
"index",
54
"connect-mcp",
65
"agents",
76
"actions-as-tools",

content/docs/api/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"title": "API & SDK",
33
"pages": [
4-
"index",
54
"data-api",
65
"metadata-api",
76
"plugin-endpoints",

content/docs/automation/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"title": "Automation",
33
"pages": [
4-
"index",
54
"hooks",
65
"hook-bodies",
76
"flows",

content/docs/capabilities/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"title": "What Can It Do?",
33
"pages": [
4-
"index",
54
"data",
65
"views",
76
"forms",

content/docs/concepts/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"title": "Core Concepts",
33
"pages": [
4-
"index",
54
"architecture",
65
"metadata-driven",
76
"metadata-lifecycle",

content/docs/data-modeling/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"title": "Data Modeling",
33
"pages": [
4-
"index",
54
"schema-design",
65
"objects",
76
"fields",

content/docs/deployment/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"title": "Deployment & Operations",
33
"pages": [
4-
"index",
54
"self-hosting",
65
"production-readiness",
76
"backup-restore",

content/docs/getting-started/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"title": "Get Started",
33
"pages": [
44
"---Start Here---",
5-
"index",
65
"how-ai-development-works",
76
"build-with-claude-code",
87
"your-first-project",

0 commit comments

Comments
 (0)