The community-maintained source for legend.so: Legend apps, open-source libraries, and Legend Spark. Issues and pull requests belong in this repository.
cd docs
bun install
bun devThe Next.js and Fumadocs app serves directly from /.
bun run buildThe build validates content links, exports the site to docs/dist/, then generates Markdown from the rendered documentation for versioned libraries, Spark, and Slides. Generated downloads belong to the build output; existing LLM download URLs remain supported. Next.js uses dist/ for its configured build directory too. Deploy the static export using trailing-slash directory indexes and a custom 404.html. Search is a static index at /api/search.
/: a single overview of Legend, apps, open-source libraries, and the framework; navigation links to page sections/list,/state,/motion: existing library entry points and versioned documentation/spark: framework landing page and current-source SDK guides/diff,/markdown,/music,/slides,/code,/chat-history: app and demo pages/blog: existing articles
Library documentation and interactive examples stay in their existing locations. Spark guides cover source APIs and distinguish them from the published experimental preview. Kitchen Sink is an SDK example, not a separate product landing page.
The new landing pages live in docs/src/app/(site) with components in docs/src/components/site. Styles are scoped to .legend-site so they do not change library documentation or examples. The homepage uses a custom Legend hero, app screenshots, images from the library documentation, and short product summaries; there are no separate /apps or /libraries pages.
Legend Slides has a dedicated product homepage at /slides, with an interactive
deck illustration, native captures, and selected effects from the checked-in
catalog. /slides/reference is the documentation hub; the focused guides live in
docs/content/slides, and the downloadable starter is
docs/public/slides/examples/first-deck.mdx. The illustration is a browser demo,
while the app screenshots and effect previews come from native macOS builds.
Set GTM_ID only if analytics should be enabled. LLMS_BASE_URL can override the default https://legend.so when generating documentation links.
For corrections and documentation improvements, edit docs/content and open a pull request. For larger restructuring, start an issue so contributors can discuss the change.
Homepage image sources and the hero generation prompt are documented in showcase assets.
/llms.txt links to product indexes and labels current versus archived library
versions. Each documentation page advertises its Markdown counterpart through a
text/markdown alternate link and a View Markdown action. Direct URLs such as
/slides/getting-started.md and existing /slides/llms/getting-started.md downloads
contain the rendered prose, configuration, and examples.
The postbuild generator covers every product in docs/src/lib/projects.ts.
Shared page metadata supplies canonical URLs, publisher identity, breadcrumbs,
and technical-article data. Unknown modification dates are omitted. Correction
links use this repository's issue workflow; the existing robots policy is retained.
cd docs
bun test
bun run build
bun run test:hosting
bun run preview:pagesThe build checks export coverage, discovery links, metadata, and canonical List and Slides examples. The hosting check runs the actual local Cloudflare Pages runtime and checks direct downloads, Accept negotiation, cache variants, HEAD, 404s, search, and robots. It needs no Cloudflare account.
docs/hosting/worker.ts is bundled into dist/_worker.js. It serves Markdown
when explicitly preferred via Accept: text/markdown, respects quality values,
and falls back to HTML when no Markdown exists. Negotiated documentation uses
Vary: Accept and Cache-Control: private, no-store to prevent variant mixing;
static assets remain cacheable. _routes.json bypasses the worker for asset paths.
Before production rollout, also verify these responses on a remote Pages preview; local runtime results do not certify account-specific edge configuration.
- Production branch:
production - Root directory:
docs - Build command:
bun install --frozen-lockfile && bun run build - Output directory:
dist - Environment:
BUN_VERSION=1.3.14,LLMS_BASE_URL=https://legend.so
The curated Legend List source listings are checked in under
docs/vendor/legend-list, pinned to an upstream commit. No sibling checkout is
needed for deployment. See its refresh instructions.
Attach legend.so as the Pages custom domain. Pushing to production triggers the configured Pages deployment.
After merging and pushing the desired changes to main, run from the repository root:
bun run deploy:production --dry-run
bun run deploy:productionRequires Git and GitHub CLI (gh) authenticated as jmeistrich, plus Git push
credentials for the same account. The script promotes the latest remote main
commit to production with a normal fast-forward push. It creates production
on the first deployment. Local commits and uncommitted files are not deployed.
Cloudflare runs the configured install and build command after the push.
GitHub rules restrict creation and updates of production to jmeistrich.
A separate rule blocks force pushes and deletion for everyone. These rules apply
to direct pushes and PR merges; the script's account check is only a convenience.
Repository administrators can still edit the rules themselves, so administrative
access must remain trusted. No deployment credentials are stored in this repo.