@@ -43,7 +43,8 @@ interaction handling is required.
4343
4444** Support both ` children ` and ` self ` values:**
4545
46- - If current page is a section with ` sidebar_root_for: "self" ` , use it as sidebar root
46+ - If current page is a section with ` sidebar_root_for: "self" ` , use it as
47+ sidebar root
4748- Otherwise, walk up ancestors to find any section with ` sidebar_root_for `
4849 (either ` "self" ` or ` "children" ` )
4950- Use the closest match as sidebar root
@@ -52,6 +53,7 @@ interaction handling is required.
5253- Pass ` sidebarRoot ` to ` sidebar-tree.html ` as parameter
5354
5455** Logic:**
56+
55571 . Check if current page has ` sidebar_root_for: "self" ` → use it
56582 . Else check ancestors for ` sidebar_root_for ` (any value) → use first match
57593 . Result: ` self ` applies to section itself, ` children ` only to descendants
@@ -113,18 +115,21 @@ sidebar_root_for: children
113115```
114116
115117** With ` sidebar_root_for: children ` :**
118+
116119- Viewing ` /docs/adding-content/ ` index → shows ** full** docs navigation
117120- Viewing ` /docs/adding-content/content/ ` → shows ** rooted** sidebar (only
118121 "Content and Customization" and its children)
119122
120123** With ` sidebar_root_for: self ` :**
124+
121125- Viewing ` /docs/adding-content/ ` index → shows ** rooted** sidebar
122126- Viewing ` /docs/adding-content/content/ ` → shows ** rooted** sidebar
123127- Both the section itself and descendants get the focused navigation
124128
125129### To-dos
126130
127- - [ ] Step 1: Update sidebar_root_for lookup to support both "self" and "children" values
131+ - [ ] Step 1: Update sidebar_root_for lookup to support both "self" and
132+ "children" values
128133- [ ] Step 2: Add link back to site root section index page
129134- [ ] Step 3: Add breadcrumb navigation UI (OPTIONAL/FUTURE)
130135- [x] Step 4: Use sidebar_root_for for $navRoot calculation in sidebar-tree.html
0 commit comments