From 6f749f079082e89d2fa6f23ea516763976a68d35 Mon Sep 17 00:00:00 2001 From: Jalil Arfaoui Date: Mon, 16 Mar 2026 18:08:30 +0100 Subject: [PATCH] =?UTF-8?q?Talk=20React=20Academy=20Conf=20:=20redux-saga?= =?UTF-8?q?=20vs=20redux-observable=20avec=20Mo=C3=AFse=20Fiscal=20(FR/EN/?= =?UTF-8?q?AR)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Collection talks avec copresenters dans le schema, dateFormatted calculé, vidéo YouTube embeddée. Composants TalkCard et TalksSection extraits pour éviter la duplication entre les 3 pages code/index. --- src/components/code/TalkCard.astro | 68 ++++++++++++++++++++++ src/components/code/TalksSection.astro | 38 ++++++++++++ src/content.config.ts | 20 ++++--- src/content/talks/react-academy-conf.ar.md | 5 ++ src/content/talks/react-academy-conf.en.md | 5 ++ src/content/talks/react-academy-conf.md | 13 +++++ src/pages/ar/برمجة/index.astro | 3 + src/pages/code/index.astro | 3 + src/pages/en/code/index.astro | 3 + 9 files changed, 151 insertions(+), 7 deletions(-) create mode 100644 src/components/code/TalkCard.astro create mode 100644 src/components/code/TalksSection.astro create mode 100644 src/content/talks/react-academy-conf.ar.md create mode 100644 src/content/talks/react-academy-conf.en.md create mode 100644 src/content/talks/react-academy-conf.md diff --git a/src/components/code/TalkCard.astro b/src/components/code/TalkCard.astro new file mode 100644 index 0000000..94210ca --- /dev/null +++ b/src/components/code/TalkCard.astro @@ -0,0 +1,68 @@ +--- +import type { Locale } from '../../utils/i18n'; + +interface Props { + title: string; + description: string; + event?: string; + dateFormatted?: string; + location?: string; + video?: string; + tags?: string[]; + copresenters?: { name: string; url: string }[]; + lang?: Locale; +} + +const { title, description, event, dateFormatted, location, video, tags, copresenters, lang = 'fr' } = Astro.props; + +const copresenterLabel = { fr: 'Co-présenté avec', en: 'Co-presented with', ar: 'محاضرة مشتركة مع' }[lang]; + +function getYouTubeId(url: string): string | null { + const match = url.match(/(?:youtu\.be\/|youtube\.com\/watch\?v=)([^&]+)/); + return match?.[1] ?? null; +} + +const videoId = video ? getYouTubeId(video) : null; +--- + +
+ {(event || dateFormatted || location) && ( +
+ {[event, dateFormatted, location].filter(Boolean).join(' · ')} +
+ )} +

{title}

+

{description}

+ {copresenters && copresenters.length > 0 && ( +

+ {copresenterLabel}{' '} + {copresenters.map((cp, i) => ( + <> + {i > 0 && ', '} + {cp.name} + + ))} +

+ )} + + {tags && tags.length > 0 && ( +
+ {tags.map((tag) => ( + + {tag} + + ))} +
+ )} + + {videoId && ( +