From eaa443fb78125b9c47cf1795bb433174ecceeee5 Mon Sep 17 00:00:00 2001 From: mikhailbond1 Date: Sun, 26 Apr 2026 15:19:40 -0400 Subject: [PATCH] Add localized fallback route for p5.sound reference pages --- src/pages/[locale]/reference/p5.sound.astro | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/pages/[locale]/reference/p5.sound.astro diff --git a/src/pages/[locale]/reference/p5.sound.astro b/src/pages/[locale]/reference/p5.sound.astro new file mode 100644 index 0000000000..68232bfb76 --- /dev/null +++ b/src/pages/[locale]/reference/p5.sound.astro @@ -0,0 +1,22 @@ +--- +import ReferenceLayout from "@layouts/ReferenceLayout.astro"; +import { nonDefaultSupportedLocales } from "@i18n/const"; +import { getCollectionInLocaleWithFallbacks } from "@pages/_utils"; + +export async function getStaticPaths() { + const paths = nonDefaultSupportedLocales.map(async (locale) => { + const entries = await getCollectionInLocaleWithFallbacks("reference", locale); + const soundEntries = entries.filter((e) => e.data.module === "p5.sound"); + return { + params: { locale }, + props: { soundEntries }, + }; + }); + + return await Promise.all(paths); +} + +const { soundEntries } = Astro.props; +--- + +