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

View File

@@ -1,20 +1,14 @@
---
import { makeHierarchy } from '../lib/hierarchy';
import { getCollection } from 'astro:content';
import NotchedBox from './NotchedBox.astro';
import NoteHierarchy from './NoteHierarchy.astro';
const notes = await getCollection('notes');
const hierarchy = makeHierarchy(notes.map(note => [note.id, note.data.title]));
const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, '');
const isActive = pathname.startsWith("notes");
---
<NotchedBox fillNotches={isActive ? 'left' : 'none'}>
<div class="notes-header">Notes</div>
<div class="note-links">
<NoteHierarchy prefix="/notes" hierarchy={hierarchy} />
<NoteHierarchy prefix="/notes" />
</div>
</NotchedBox>