Add TOC and Layout components; update pages

This commit is contained in:
mido
2026-04-15 11:23:10 -05:00
parent 57f672386a
commit 56ea450e7b
6 changed files with 101 additions and 43 deletions

View File

@@ -0,0 +1,21 @@
---
import { getCollection } from "astro:content";
const { sectionName } = Astro.props;
const entries = (await getCollection(sectionName)).sort((a, b) =>
a.data.title.localeCompare(b.data.title),
);
const articles = entries.filter((entry) => entry.id !== "index");
---
<ul>
{articles.map((entry) => (
<li>
<a href={`/${sectionName}/${entry.id}`}>
{entry.data.title}
</a>
</li>
))}
</ul>