Multi-Subsite Architecture
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.
Configuration
The central configuration for subsites is located in shared-route-config.ts. This file acts as the single source of truth for:
- Subsite Metadata: Defines the list of available subsites.
- Shared Routes: Defines which documentation sections are shared across subsites.
SubsiteConfig
Each subsite is defined by a SubsiteConfig object:
Adding a New Subsite
To add a new subsite (e.g., my-framework):
- Create Directory: Create
docs/en/my-framework/(anddocs/zh/my-framework/). - Update Config: Add a new entry to
SUBSITES_CONFIGinshared-route-config.ts. - Configure Sidebar: Create
docs/en/my-framework/_meta.jsonto define its specific sidebar structure.
The shared entry: Quick Start
SHARED_DOC_TITLES historically held several cross-subsite docs (tutorials, integration guides, …) and the build mapped them to virtual /<subsite>/start/<filename> routes. Those docs have since either been folded into ChoiceTabs or lifted out to top-level /learn/*. Quick Start is the only one that still genuinely belongs to "everyone's first-run experience."
Its canonical URL is pinned in shared-route-config.ts as QUICK_START_PATH (= /guide/start/quick-start). We park it under /guide/ because Lynx is the runtime substrate every other subsite is defined relative to (Rspeedy = build tool for Lynx, ReactLynx = React on Lynx, …), so routing the platform's onboarding doorway under the platform is the honest framing — the page's job is to send you into a framework, not to belong to one.
How it works
- Source of truth: the file lives at
docs/{en,zh}/guide/start/quick-start.mdx. - Sidebar entry: clicking the Lynx icon in
SubsiteRowroutes toQUICK_START_PATHinstead of the Lynx subsite'surl. The other icons keep navigating to their respective subsite landings. - Historical-URL compatibility: legacy
/<ai|react|rspeedy|lynx-ui>/start/*URLs are 301'd to/guide/start/*innetlify.toml, so bookmarks and LLM-cached references keep resolving.
Subsite UI
Subsite navigation and identity are handled by custom theme components:
SubsiteRow(theme/SubsiteRow.tsx): horizontal row of all subsite icons at the top of the sidebar; the active subsite gets a brand-themed border.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.