finish TOC component

This commit is contained in:
2026-03-01 18:34:48 -05:00
parent dfdf6c6e66
commit 6b0a985ee1
10 changed files with 630 additions and 21 deletions

View File

@@ -6,6 +6,9 @@ import Post from '@components/Post.astro';
export async function getStaticPaths() {
const entries = await getCollection('posts');
entries.sort((a, b) => a.data.date.getTime() - b.data.date.getTime())
// for each route, the page gets passed the entry itself, plus the previous and next slugs
// (if any), so that it can render links to them
return entries.map((entry, idx) => {
const prevSlug = entries[idx - 1]?.id || null;
const nextSlug = entries[idx + 1]?.id || null;