--- import { getCollection, render } from "astro:content"; import GameLayout from "../../layouts/GameLayout.astro"; export async function getStaticPaths() { const classEntries = await getCollection("classes"); return classEntries.map((entry) => ({ params: { slug: entry.id }, props: { entry }, })); } const { entry } = Astro.props; if (!entry) return Astro.redirect("/404"); const { Content } = await render(entry); // Récupération de l'évolution (si elle existe, sinon on crée un défaut avec le niveau 1) const evolution = entry.data.evolution || { "1": entry.data.capacites_niveau_1 || [], }; const niveaux = Object.keys(evolution).sort((a, b) => Number(a) - Number(b)); const maxLevel = niveaux[niveaux.length - 1]; const themeColor = entry.data.couleur_theme || `var(--color-${entry.data.encre})`; ---
← Retour à la création
Encre {entry.data.encre} Dé de vie : {entry.data.de_vie}

{entry.data.title}

{entry.data.description}

{ entry.data.stats_prioritaires && entry.data.stats_prioritaires.length > 0 && (

Stats Prioritaires

{entry.data.stats_prioritaires.map((stat) => ( {stat} ))}
) }

Capacités : Niveau 1

{ niveaux.length > 1 && ( ) }
{ niveaux.map((lvl) => (
{evolution[lvl].map((cap) => ( {cap} ))}
)) }