--- import { getCollection, render } from "astro:content"; import Layout from "../../layouts/main.astro"; const locale = "fr"; const experiences = (await getCollection("experiences")) .filter((e) => e.data.lang === locale && !e.data.draft) .sort((a, b) => (b.data.startDate > a.data.startDate ? 1 : -1)); const typeIcons: Record = { employment: '🏢', freelance: '💼', teaching: '🎓', community: '🤝', entrepreneurship: '🚀', }; function formatMonth(dateStr: string) { const [year, month] = dateStr.split('-'); return new Date(parseInt(year), parseInt(month) - 1) .toLocaleDateString('fr-FR', { year: 'numeric', month: 'short' }); } ---
Code

Parcours

Plus de 20 ans d'expérience en développement logiciel.

{experiences.map(async (exp) => { const { Content } = await render(exp); const isOngoing = !exp.data.endDate; const start = formatMonth(exp.data.startDate); const end = exp.data.endDate ? formatMonth(exp.data.endDate) : 'Présent'; return (
{isOngoing &&
}
{typeIcons[exp.data.type] || '💼'} {start} — {end} {exp.data.location && · {exp.data.location}}

{exp.data.role}

{exp.data.companyUrl ? ( {exp.data.company} ) : exp.data.company}

{exp.data.technologies && exp.data.technologies.length > 0 && (
{exp.data.technologies.map((tech: string) => ( {tech} ))}
)}
); })}