generated from avior/template-web-astro
@ -5,16 +5,16 @@ import Article from 'layouts/Article.astro'
|
||||
export const prerender = true
|
||||
// 1. Generate a new path for every collection entry
|
||||
export async function getStaticPaths() {
|
||||
const blogEntries = await getCollection('projects');
|
||||
return blogEntries.map(entry => ({
|
||||
params: { project: entry.slug }, props: { entry },
|
||||
}));
|
||||
const blogEntries = await getCollection('projects');
|
||||
return blogEntries.map((entry) => ({
|
||||
params: { project: entry.slug }, props: { entry },
|
||||
}))
|
||||
}
|
||||
// 2. For your template, you can get the entry directly from the prop
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
---
|
||||
<Article title={entry.data.title} link={entry.data.link} breadcrumb={[{text: 'Accueil', href: '/'}, {text: 'Projets', href: '/projets'}, {text: entry.data.title}]}>
|
||||
<Article title={entry.data.title} image={[entry.data.image]} description={entry.data.description} link={entry.data.link} breadcrumb={[{text: 'Accueil', href: '/'}, {text: 'Projets', href: '/projets'}, {text: entry.data.title}]}>
|
||||
<h1>{entry.data.title}</h1>
|
||||
<p class="flex justify-end font-lights my-0">
|
||||
<span>Sortie initial le {entry.data.created.toLocaleDateString('fr')}</span>
|
||||
|
Reference in New Issue
Block a user