Navigation and satellites
svelte
<script lang="ts">
import {
Navigation,
ContentPage,
SidebarNavigation,
Section,
} from '@page-sections/svelte';
import { resolveNavigation, type MenuItem } from '@page-sections/core';
const tree: MenuItem[] = [
{
id: 'guides',
label: 'Guides',
href: '/guides/',
children: [
{
id: 'garden',
label: 'Garden',
href: '/guides/garden/',
children: [
{ id: 'planting', label: 'Planting', href: '/guides/garden/planting/' },
],
},
],
},
];
const navigation = resolveNavigation(tree, { currentId: 'planting' });
</script>
<Navigation items={navigation.items}>
{#snippet brand()}<a href="/">Garden journal</a>{/snippet}
</Navigation>
<ContentPage
page={{ title: 'Planting', breadcrumbs: navigation.breadcrumbs }}
showContentMenu
>
{#snippet leftSidebar()}<SidebarNavigation items={navigation.sidebarItems} />{/snippet}
<Section section={{ id: 'soil', title: 'Soil' }}
><p>Start with healthy soil.</p></Section
>
</ContentPage>