diff --git a/packages/starlight/src/utils/navigation.ts b/packages/starlight/src/utils/navigation.ts --- a/packages/starlight/src/utils/navigation.ts +++ b/packages/starlight/src/utils/navigation.ts @@ -106,6 +106,9 @@ const localeDir = locale ? locale + '/' + directory : directory; const autogenerate = { directory }; const dirDocs = routes.filter((doc) => { + // An empty directory (e.g. `directory: '/'`) targets the root of the content collection + // and should include every route for the current locale. + if (localeDir === '') return true; const filePathFromContentDir = getRoutePathRelativeToCollectionRoot(doc, locale); return ( // Match against `foo.md` or `foo/index.md`.