--- import { getCollection } from "astro:content"; import Layout from "../layouts/Layout.astro"; import TimelineBoard from "../components/TimelineBoard.astro"; import Card from "../components/Card.astro"; import EventCard from "../components/EventCard.astro"; export async function getStaticPaths() { const allHumans = await getCollection("humans"); const allEvents = await getCollection("events"); const sortedHumans = allHumans.sort( (a, b) => new Date(b.data.date).getTime() - new Date(a.data.date).getTime(), ); const humanPaths = allHumans.map((entry) => ({ params: { id: entry.id.replace(/\.md$/, "") }, props: { entry, sortedEntries: sortedHumans, type: "human" }, })); const eventPaths = allEvents.map((entry) => ({ params: { id: entry.id.replace(/\.md$/, "") }, props: { entry, sortedEntries: [], type: "event" }, })); return [...humanPaths, ...eventPaths]; } const { entry, sortedEntries, type } = Astro.props; const { Content } = await entry.render(); const manifestations = entry.data.manifestations || []; const groupedManifestations = manifestations.reduce((acc, m) => { if (!acc[m.cercle]) acc[m.cercle] = []; acc[m.cercle].push(m); return acc; }, {}); const circleOrder = ["PRO", "SAN", "HYG", "SOC", "FLX"]; --- ← Retour à la collection { type === "human" ? ( ) : ( ) }