---
import { getCollection } from 'astro:content';
import Default from '../../content/layouts/Default.astro';

export const getStaticPaths = async () => {
	const entries = await getCollection('chapters');
	return entries.map(entry => ({
		params: { slug: entry.slug }, props: { entry },
	}));
}

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

<Default title={entry.data.title}>
	<Content />
</Default>
