--- import BaseLayout from "../layouts/BaseLayout.astro"; import { sortItem } from "../utils/sort.js"; import { getCollection } from "astro:content"; import type { PostCollection } from "../types"; const title = "Barrett Ruth"; const CATS: PostCollection[] = [ "algorithms", "software", "meditations", "autonomous-racing", ]; type PostData = { id: string; slug: string; data: { title: string; date: string | null; }; }; const postsByCategory: Record = {}; for (const c of CATS) { const entries = await getCollection(c); entries.sort(sortItem); postsByCategory[c] = entries.map((e) => ({ id: `${c}/${e.slug}.mdx`, slug: e.slug, data: { title: e.data.title ?? e.slug, date: e.data.date ?? null, }, })); } ---