Lynx

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:

  1. Subsite Metadata: Defines the list of available subsites.
  2. Shared Routes: Defines which documentation sections are shared across subsites.

SubsiteConfig

Each subsite is defined by a SubsiteConfig object:

export type SubsiteConfig = {
  value: string; // Unique ID (e.g., 'guide')
  label: string; // Display name (e.g., 'Lynx')
  description: string; // Short description
  home: string; // Root path (e.g., '/')
  url: string; // Landing page URL
  logo: {
    // Logo assets
    light: string;
    dark: string;
  };
};

Adding a New Subsite

To add a new subsite (e.g., my-framework):

  1. Create Directory: Create docs/en/my-framework/ (and docs/zh/my-framework/).
  2. Update Config: Add a new entry to SUBSITES_CONFIG in shared-route-config.ts.
    {
      value: 'my-framework',
      label: 'My Framework',
      // ...
    }
  3. Configure Sidebar: Create docs/en/my-framework/_meta.json to 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

  1. Source of truth: the file lives at docs/{en,zh}/guide/start/quick-start.mdx.
  2. Sidebar entry: clicking the Lynx icon in SubsiteRow routes to QUICK_START_PATH instead of the Lynx subsite's url. The other icons keep navigating to their respective subsite landings.
  3. Historical-URL compatibility: legacy /<ai|react|rspeedy|lynx-ui>/start/* URLs are 301'd to /guide/start/* in netlify.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.

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.