The Lynx website operates as a collection of "mini-subsites" (e.g., Lynx, ReactLynx, Rspeedy) housed within a single repository. This architecture allows each subsite to have its own identity (logo, home page, sidebar) while sharing common documentation and infrastructure.
The central configuration for subsites is located in shared-route-config.ts. This file acts as the single source of truth for:
SubsiteConfigEach subsite is defined by a SubsiteConfig object:
To add a new subsite (e.g., my-framework):
docs/en/my-framework/ (and docs/zh/my-framework/).SUBSITES_CONFIG in shared-route-config.ts.
docs/en/my-framework/_meta.json to define its specific sidebar structure.To avoid duplicating content (like "Quick Start" guides) across multiple subsites, we use a shared documentation system.
docs/en/guide/start/.sharedSidebarPlugin in rspress.config.ts dynamically creates virtual pages for other subsites (e.g., react/start/quick-start) that point to the same content.BeforeSidebar component (in theme/BeforeSidebar.tsx) automatically injects the shared "Start" section into the sidebar of every subsite.To modify which files are shared, update SHARED_DOC_TITLES in shared-route-config.ts.
The subsite navigation and identity are handled by custom theme components:
SubsiteSelect (theme/BeforeSidebar.tsx): The dropdown menu at the top of the sidebar allows users to switch between subsites.SubsiteLogo (theme/subsite-ui.tsx): Renders the correct logo for the current subsite and theme mode.These components read directly from SUBSITES_CONFIG, so any changes there are immediately reflected in the UI.