diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index 9993240..8c5b03b 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -24,9 +24,20 @@ interface Props { description?: string; /** Keep the page out of search engines (still reachable by URL). For share-only pages. */ noindex?: boolean; + /** Client-side language auto-routing sends a default-locale page to the visitor's preferred + * built locale. Turn OFF on pages that exist only in the default locale (event guides, 404, + * offline, go-eu): they have no localized counterpart, so redirecting a non-English visitor + * lands on a 404, and the 404 page re-running the script is what stacked /cs/cs/cs forever. */ + autoRoute?: boolean; } -const { title, lang = 'en', description: pageDescription, noindex = false } = Astro.props; +const { + title, + lang = 'en', + description: pageDescription, + noindex = false, + autoRoute = true, +} = Astro.props; const t = useTranslations(lang); // Every in-site link goes through localeHref: a two-way `lang === 'en' ? … : '/nl/…'` sent // every non-English visitor to Dutch, which made /fr/ a dead end on .be and put a Dutch @@ -126,7 +137,7 @@ const orgLd = { } } - {LOCALES.length > 1 && ( + {LOCALES.length > 1 && autoRoute && (