commit
9cc1530f2e
58 files changed
+5631
No files matched your search
@@ -0,0 +1,34 @@
|
||||
---
|
||||
import { Image } from 'astro:assets';
|
||||
import { render } from 'astro:content';
|
||||
import type { CollectionEntry } from 'astro:content';
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||
import { dateActu, getActualites } from '../../lib/site';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return (await getActualites()).map((actu) => ({ params: { id: actu.id }, props: { actu } }));
|
||||
}
|
||||
|
||||
const { actu } = Astro.props as { actu: CollectionEntry<'actualites'> };
|
||||
const { titre, resume, image, image_alt } = actu.data;
|
||||
const { Content } = await render(actu);
|
||||
---
|
||||
|
||||
<BaseLayout titre={titre} description={resume}>
|
||||
<main class="section">
|
||||
<article>
|
||||
<a class="retour" href="/actualites/">← Toute l'actualité</a>
|
||||
<div class="date">{dateActu(actu.data)}</div>
|
||||
<h1 class="titre-page">{titre}</h1>
|
||||
{image && <Image class="visuel" src={image} alt={image_alt} widths={[600, 900]} sizes="(max-width: 900px) 100vw, 820px" />}
|
||||
<div class="prose"><Content /></div>
|
||||
</article>
|
||||
</main>
|
||||
</BaseLayout>
|
||||
|
||||
<style>
|
||||
article { max-width: 820px; display: flex; flex-direction: column; gap: 16px; }
|
||||
.retour { font-weight: 600; font-size: 16px; margin-bottom: 12px; }
|
||||
.date { font-size: 15px; color: var(--orange); font-weight: 600; }
|
||||
.visuel { width: 100%; border-radius: var(--rayon); margin: 12px 0; }
|
||||
</style>
|
||||
Reference in new issue
Block a user