this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Change markdown for nested nav items

- Only top level pops out
- Only one popout is open at once
- Name is in a span for styling

+22 -6
+22 -6
src/components/generic/Nav.astro
··· 11 11 { 12 12 (() => { 13 13 const a = (name: string, href: string) => <a {href}>{name}</a>; 14 - const render = (name: string, children: nav[]) => ( 15 - <details> 16 - <summary>{name}</summary> 14 + const render = ( 15 + name: string, 16 + children: nav[], 17 + popout: boolean = true, 18 + ) => { 19 + const list = ( 17 20 <ul> 18 21 {children.map((x) => ( 19 22 <li> 20 23 {x.children 21 - ? render(x.name, x.children) 24 + ? render(x.name, x.children, false) 22 25 : a(x.name, x.url || "")} 23 26 </li> 24 27 ))} 25 28 </ul> 26 - </details> 27 - ); 29 + ); 30 + return popout ? ( 31 + <details name="nav"> 32 + <summary> 33 + <span>{name}</span> 34 + </summary> 35 + {list} 36 + </details> 37 + ) : ( 38 + <> 39 + <span>{name}</span> 40 + {list} 41 + </> 42 + ); 43 + }; 28 44 return data.map((entry) => ( 29 45 <li> 30 46 {entry.children