Adds notes to mobile menu
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
---
|
||||
import { type Hierarchy } from "../lib/hierarchy.ts";
|
||||
import { makeHierarchy } from '../lib/hierarchy';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
interface Props {
|
||||
prefix: string;
|
||||
hierarchy: Hierarchy;
|
||||
hierarchy?: Hierarchy;
|
||||
}
|
||||
|
||||
const { prefix, hierarchy } = Astro.props;
|
||||
const { prefix, hierarchy: maybeHierarchy} = Astro.props;
|
||||
|
||||
const hierarchy = maybeHierarchy ?? makeHierarchy((await getCollection('notes')).map(note => [note.id, note.data.title]));
|
||||
|
||||
|
||||
const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, '/');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user