From e58753d4668e867b04316a79495d690a3291df87 Mon Sep 17 00:00:00 2001 From: Cian Monnin Date: Fri, 13 Nov 2026 14:23:40 -0500 Subject: [PATCH 1/2] feat(outreach): publish the blog in French Add French translations of the five published posts. A translation names its original in a new `translationOf` frontmatter field, and the language toggle on a post now opens its counterpart, or the other language's blog index when it has none, instead of a 404. Co-Authored-By: Claude Opus 5.5 --- .agents/docs/playbooks/add-blog-post.md | 6 ++ .../src/components/layout/Header.astro | 7 +- .../components/layout/LanguageToggle.astro | 12 +++- apps/outreach/src/content/config.ts | 1 + apps/outreach/src/layouts/Page.astro | 5 +- apps/outreach/src/lib/blog.ts | 32 +++++++++- .../src/pages/[locale]/blog/[slug].astro | 16 +++-- ...dopter-de-bonnes-conventions-de-nommage.md | 35 ++++++++++ ...plateformes-libres-de-saisie-de-donnees.md | 31 +++++++++ blog/l-infonuagique-en-sante.md | 43 +++++++++++++ blog/naviguer-la-bureaucratie.md | 23 +++++++ ...pen-data-capture-v2-saisir-des-fichiers.md | 64 +++++++++++++++++++ 12 files changed, 262 insertions(+), 13 deletions(-) create mode 100644 blog/adopter-de-bonnes-conventions-de-nommage.md create mode 100644 blog/avantages-des-plateformes-libres-de-saisie-de-donnees.md create mode 100644 blog/l-infonuagique-en-sante.md create mode 100644 blog/naviguer-la-bureaucratie.md create mode 100644 blog/open-data-capture-v2-saisir-des-fichiers.md diff --git a/.agents/docs/playbooks/add-blog-post.md b/.agents/docs/playbooks/add-blog-post.md index 9ec79e5c9e..2bc3c1810a 100644 --- a/.agents/docs/playbooks/add-blog-post.md +++ b/.agents/docs/playbooks/add-blog-post.md @@ -16,6 +16,12 @@ that directory as a post. 3. **To add a new `type` value**, extend the enum in `config.ts` _and_ add the matching key to `apps/outreach/src/i18n/translations/blog.json`. The badge renders `t('blog.')`, so without the key it shows the raw key. +4. **To translate a post, give the translation its own filename in its language and set + `translationOf` to the original's filename without `.md`.** Set it on the translation only: + `getPublishedAltPost()` in `apps/outreach/src/lib/blog.ts` pairs the two from that one field and + fails the build if it names no post, if a post would pair with more than one other, or if both + are in the same language. Without it, the language toggle on either post goes to the other + language's blog index instead of the translation. ## Traps diff --git a/apps/outreach/src/components/layout/Header.astro b/apps/outreach/src/components/layout/Header.astro index 898860962c..1ecb8d54bd 100644 --- a/apps/outreach/src/components/layout/Header.astro +++ b/apps/outreach/src/components/layout/Header.astro @@ -9,6 +9,11 @@ import SiteTitle from '../common/SiteTitle.astro'; import MenuIcon from '../icons/MenuIcon.astro'; import XMarkIcon from '../icons/XMarkIcon.astro'; +type Props = { + altURL?: URL; +}; + +const { altURL } = Astro.props; const { t, translatePath } = useTranslations(Astro.url); const navLinks = [ @@ -47,7 +52,7 @@ const navLinks = [
- +