File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33* .generated. *
44/.cache
55/pages /api
6+ /pages /loaders
7+ /pages /plugins
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub';
22import LinkedInIcon from '@node-core/ui-components/Icons/Social/LinkedIn' ;
33import DiscordIcon from '@node-core/ui-components/Icons/Social/Discord' ;
44import XIcon from '@node-core/ui-components/Icons/Social/X' ;
5- import { footer } from '#theme/site' with { type : 'json' } ;
5+ import { footer } from '#theme/site' ;
66
77import Logo from '#theme/Logo' ;
88import styles from './index.module.css' ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub';
55
66import SearchBox from '@node-core/doc-kit/src/generators/web/ui/components/SearchBox' ;
77import { useTheme } from '@node-core/doc-kit/src/generators/web/ui/hooks/useTheme.mjs' ;
8- import { navbar } from '#theme/site' with { type : 'json' } ;
8+ import { navbar } from '#theme/site' ;
99import Logo from '#theme/Logo' ;
1010
1111/**
Original file line number Diff line number Diff line change 11import SideBar from '@node-core/ui-components/Containers/Sidebar' ;
2- import { sidebar } from '#theme/local/site' with { type : 'json' } ;
2+ import { sidebar } from '#theme/local/site' ;
33
44/** @param {string } url */
55const redirect = url => ( window . location . href = url ) ;
@@ -8,15 +8,24 @@ const PrefetchLink = props => <a {...props} rel="prefetch" />;
88
99const pathnameFor = path => path . replace ( / \/ i n d e x $ / , '' ) || '/' ;
1010
11+ const groupsFor = path => {
12+ const segment = path . split ( '/' ) . filter ( Boolean ) [ 0 ] ;
13+ const matched = sidebar . filter ( g => g . groupName . toLowerCase ( ) === segment ) ;
14+ return matched . length > 0 ? matched : sidebar ;
15+ } ;
16+
1117/**
1218 * Sidebar component for MDX documentation with page navigation.
1319 */
14- export default ( { metadata } ) => (
15- < SideBar
16- pathname = { pathnameFor ( metadata . path ) }
17- groups = { sidebar }
18- onSelect = { redirect }
19- as = { PrefetchLink }
20- title = "Navigation"
21- />
22- ) ;
20+ export default ( { metadata } ) => {
21+ const path = pathnameFor ( metadata . path ) ;
22+ return (
23+ < SideBar
24+ pathname = { path }
25+ groups = { groupsFor ( path ) }
26+ onSelect = { redirect }
27+ as = { PrefetchLink }
28+ title = "Navigation"
29+ />
30+ ) ;
31+ } ;
You can’t perform that action at this time.
0 commit comments