Files
site-portfolio/src/pages/atelier/[...slug].astro
T

19 lines
495 B
Plaintext

---
import { getCollection, render } from 'astro:content';
import Projet from '../../layouts/Projet.astro';
export async function getStaticPaths() {
const projets = await getCollection(
'projets',
({ data }) => data.categorie === 'atelier' && !data.brouillon,
);
return projets.map((projet) => ({ params: { slug: projet.id }, props: { projet } }));
}
const { projet } = Astro.props;
const { Content } = await render(projet);
---
<Projet {...projet.data}>
<Content />
</Projet>