rewrite nav
This commit is contained in:
parent
6249a0aba7
commit
5341fe58d0
18 changed files with 254 additions and 415 deletions
23
src/components/navigation/sidebars/nav/Tree.astro
Normal file
23
src/components/navigation/sidebars/nav/Tree.astro
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
import NavCollapsible from "@components/NavCollapsible.astro";
|
||||
import Self from "./Tree.astro";
|
||||
import Link from "./Link.astro";
|
||||
|
||||
interface TreeEntry {
|
||||
title: string;
|
||||
link: string;
|
||||
current?: boolean;
|
||||
entries?: TreeEntry[];
|
||||
}
|
||||
|
||||
interface Props extends TreeEntry {}
|
||||
|
||||
const { title, link, entries, current } = Astro.props;
|
||||
---
|
||||
<NavCollapsible title={title} link={link} current={current ?? false}>
|
||||
{entries?.map(entry => entry.entries ? (
|
||||
<Self {...entry}/>
|
||||
) : (
|
||||
<Link title={entry.title} link={entry.link} current={entry.current}/>
|
||||
))}
|
||||
</NavCollapsible>
|
Loading…
Add table
Add a link
Reference in a new issue