Adds notes to mobile menu

This commit is contained in:
2026-05-01 18:26:19 -07:00
parent 9af10f938e
commit 5535a30873
5 changed files with 60 additions and 11 deletions
+7 -2
View File
@@ -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, '/');