---
import { type CollectionEntry, getCollection, render } from 'astro:content';
import PostLayout from '../../layouts/PostLayout.astro';

export async function getStaticPaths() {
	const posts = await getCollection('workshop');
	return posts.map((post) => ({
		params: { slug: post.id },
		props: post,
	}));
}
type Props = CollectionEntry<'workshop'>;

const post = Astro.props;
const { Content } = await render(post);
---

<PostLayout {...post.data}>
	<Content />
</PostLayout>
