基础
Project Structure
Choose a Lotus project layout based on routing, localization, and customization needs.
Lotus does not require one fixed directory layout. Start with the smallest structure that matches the site, then add locale, custom pages, or override folders only when the project needs them.
Docs Only
Use this for a documentation-only site where every page lives under the docs route.
- astro.config.tsregisters the Lotus integration
- theme.config.jsonstores Lotus theme config
Directory src
- content.config.tsregisters the docs collection
Directory content
Directory docs
- index.mdxdocs homepage
- overview.mdx
- installation.mdx
Directory configuration
- project.mdx
Directory public
- favicon.svg
Keep the default loader base and the default docsBase: '/'.
Docs At Root
Use this for a documentation-only site. It matches Lotus defaults and does not
need an explicit docsBase.
- astro.config.tsregisters the Lotus integration
- theme.config.jsonuses the default
docsBase: '/' Directory src
- content.config.tsregisters the docs collection
Directory content
Directory docs
- index.mdxhomepage at
/ - installation.mdx
Directory components
- icon.mdx
- index.mdxhomepage at
Directory public
- favicon.svg
With this setup, installation.mdx renders at /installation/, and its
Markdown route is /installation.md.
Homepage + Docs
Use this when the site needs a top-level marketing or product homepage at /
and documentation under /docs.
- astro.config.tsregisters the Lotus integration
- theme.config.jsonsets
docsBase: '/docs' Directory src
- content.config.tsregisters the docs collection
Directory pages
- index.astrosite homepage at
/
- index.astrosite homepage at
Directory content
Directory docs
- index.mdxdocs homepage at
/docs/ - overview.mdx
- installation.mdx
- index.mdxdocs homepage at
Directory public
- logo.svg
- favicon.svg
This structure keeps docsLoader() focused on src/content/docs. Use the
exported Lotus layouts when the custom homepage should share the same header,
footer, tokens, and theme initialization as the docs pages.
Localized Docs
Use this when each locale has its own content directory.
Directory src
- content.config.tsregisters the docs collection
Directory content
Directory docs
Directory en
- index.mdx
- overview.mdx
Directory configuration
- project.mdx
Directory zh-cn
- index.mdx
- overview.mdx
Directory configuration
- project.mdx
- theme.config.jsonmaps locale directories
Sidebar strings stay locale-neutral. Reference configuration/project, not
en/configuration/project.
With Overrides
Use this when the project replaces shell components or adds local UI around the Lotus theme.
Directory src
- content.config.ts
Directory content
Directory docs
- index.mdx
- overview.mdx
Directory components
Directory lotus
- HeaderSocialIcons.astro
- PageActions.astro
- SearchDialog.astro
Directory styles
- lotus.cssoptional custom CSS tokens
- theme.config.jsonreferences local override paths
Directory public
- logo.svg
- favicon.svg
Keep local overrides outside src/content so content remains portable and
route-focused.
-
Pick the route model first.
Decide whether docs live under
/docsor/, and whether the site has a separate homepage. -
Add locale directories only when translations exist.
A single-language site can use
src/content/docs. A localized site should move pages under directories such assrc/content/docs/enandsrc/content/docs/zh-cn. -
Keep content, theme config, and overrides separate.
Put content in
src/content, site configuration intheme.config.json, and local shell overrides insrc/components.
See Content Routing and Internationalization for route and locale behavior.