--- import { getCollection, render } from "astro:content"; import { collectionNames, isSiteCollection } from "../../config/content"; import Layout from "../../layouts/Layout.astro"; export async function getStaticPaths() { const paths = []; for (const collection of collectionNames) { const entries = await getCollection(collection); for (const entry of entries) { paths.push({ params: { collection, slug: entry.id === "index" ? undefined : entry.id, }, props: { collection, entry }, }); } } return paths; } const { collection } = Astro.params; if (!collection || !isSiteCollection(collection)) { throw new Error("Invalid collection"); } const { entry } = Astro.props; const { Content } = await render(entry); ---