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

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

const { entry } = Astro.props;
const { Content } = await entry.render();
const titlePrefix = String.fromCharCode(parseInt(entry.slug) - 1 + 65);
---

<Layout title={entry.data.title} titlePrefix={`Appendix ${titlePrefix}`}>
	<Content />
</Layout>
