Replies: 1 comment 5 replies
-
👋 Starlight does not use the What happens in the case of Starlight, which is built on top of content collections, would be similar to something like:
This is obviously quite a bit of steps, and it's only something we can do because Starlight content pages are built on top of Astro's content collections and we have control over pages that are rendered. Afaik, getting the exact same behavior with Astro's i18n features is not supported, as fallbacks only have 2 possible |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to replicate Starlight's i18n routing approach in my own Astro project, specifically:
/en/
prefix)/fr/page/
)I've seen that Starlight achieves this exact setup, but I can't figure out how to implement it in my own config. When I try:
The fallbacks try to point to
/en/page/
which doesn't exist since my English pages are at root.What's the internal mechanism Starlight uses to accomplish this routing pattern while maintaining compatibility with Pagefind?
Just to be clear, this is the behaviour that I would like (which doesnt compile not a valid astro config):
And I already have duplicate /page/index.astro /[lang]/page/index.astro just to be sure! If I dont set the
redirectToDefaultLocale: false
the generated /[lang]/page/index.html will appear with baked-in redirect which breaks pagefind indexing.Beta Was this translation helpful? Give feedback.
All reactions