---
import {type CollectionEntry, getCollection} from "astro:content";
import BaseLayout from "../../layouts/BaseLayout.astro";
export async function getStaticPaths() {
const posts = await getCollection('writing');
return posts.map(p => ({
params: {
slug: p.slug
},
props: {
title: p.data.title,
slug: p.slug,
},
}));
}
const {slug, title} = Astro.props;
const permalink = `${Astro?.site?.href}writing/${slug}`;
const writing = await getCollection('writing');
const entry: CollectionEntry<'writing'> | undefined = writing.find(e => e.slug === slug);
if (!entry) throw new Error(`Entry not found: ${slug}`);
const { Content } = await entry.render();
---