withastro / starlight

🌟 Build beautiful, accessible, high-performance documentation websites with Astro
https://starlight.astro.build
MIT License
4.9k stars 526 forks source link

Sidebar links include a locale not used by the site after 0.28.5 #2553

Open tmcw opened 6 hours ago

tmcw commented 6 hours ago

What version of starlight are you using?

0.28.5

What version of astro are you using?

4.16.8

What package manager are you using?

pnpm

What operating system are you using?

mac

What browser are you using?

Chrome

Describe the Bug

We hit an issue related to this https://github.com/withastro/starlight/pull/2548 - our docs don't use the /en/ prefix (we have defaultLocale: en), and after updating, sidebar links include the /en/ prefix and thus lead to 404s: staging deploy that replicates the issue here: https://d30789a7.val-town-docs.pages.dev/

Link to Minimal Reproducible Example

https://d30789a7.val-town-docs.pages.dev/

Participation

delucis commented 5 hours ago

Thanks for the issue @tmcw! It looks like you actually have a misconfiguration that happened to work as you expected previously, but wasn’t intended to. Sorry nonetheless for the disruption!

The locales config in your astro.config.mjs should either look like this:

      defaultLocale: 'root',
      locales: {
        root: {
          label: 'English',
          lang: 'en',
        },
      },

(as documented in the Starlight i18n guide)

OR can be omitted entirely as an English root locale is also Starlight’s default.