Nested folders in src/content/<locale>/docs/ drive the sidebar tree and preserve their path segments in public URLs.

Example mapping

These source files map like this:

Source file Route
src/content/en-US/docs/guides/index.md /docs/guides
src/content/en-US/docs/guides/sidebar-nesting.md /docs/guides/sidebar-nesting
src/content/en-US/docs/guides/route-shape.md /docs/guides/route-shape

Catch-all pages

The pages/[locale]/docs/[...slug].server.ts loader handles nested paths. Content collections provide the slugs used to prerender each page, including paths such as guides/sidebar-nesting.

Practical takeaway

Organize docs in folders to get collapsible sidebar navigation and matching /-separated routes. An index.md file maps to its containing folder's route.