Skip to content

docs: move the website to Starlight - #1361

Closed
dangreen wants to merge 8 commits into
masterfrom
docs/starlight
Closed

dangreen wants to merge 8 commits into
masterfrom
docs/starlight

Conversation

@dangreen

@dangreen dangreen commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Part 8 of the tooling stack. Based on #1360.

What

The documentation website moves from Docusaurus 3 to Astro 7 + Starlight 0.43, built from the root workspace with pnpm docs:build (sandboxes first, then astro check and astro build).

Every page URL of the old website keeps working: the pages keep their paths, and /tags/* and /search (which have no counterpart) redirect: chart tags to their component pages, /tags to the examples. /img/logo.svg and /img/favicon.ico stay; /opensearch.xml of the Docusaurus search is gone.

The four search and agent fixes

  1. Example code is page content. Each example page renders App.tsx of its sandbox as a code block next to the live preview. Before, the code existed only inside an iframe, so search engines and AI tools saw an empty page (~50 words, now 150–310).
  2. Trailing slashes everywhere. GitHub Pages serves /examples/line-chart/, but canonicals and the sitemap pointed to /examples/line-chart, which redirects twice (to http://…/ and back to https). Now trailingSlash: 'always', and a small rehype plugin adds the slash to internal links in Markdown.
  3. robots.txt + sitemap. robots.txt points to sitemap-index.xml. sitemap.xml, the address Search Console knows, still answers as an index of the new sitemap. /search and /tags/* are no longer in it.
  4. llms.txt, llms-small.txt and llms-full.txt (via starlight-llms-txt), with the example code included.

StackBlitz works again

On the current website the StackBlitz tab shows "Unable to run Embedded Project: …embedded without proper isolation headers". WebContainers need a cross-origin isolated page, which GitHub Pages cannot serve. Now:

  • the Preview tab is the sandbox built from this repository (no isolation needed, so no extra reload for readers);
  • StackBlitz → Load the editor reloads the page with ?stackblitz. A service worker (public/coi-serviceworker.js) adds COOP: same-origin + COEP: credentialless only to such navigations and to the previews they embed (an isolated page embeds only isolated frames), and the editor loads with corp=1.
  • Where the page cannot be isolated, the button opens StackBlitz in a new tab instead of reloading: Safari (no credentialless COEP) and browsers where the service worker cannot register.
  • credentialless (not require-corp as in nano_kit) keeps the EthicalAds banner and Umami working on the isolated page too. I checked it: the ad decision, image and view pixel all load.

Kept from the old website

  • EthicalAds banner in the sidebar, same publisher id, follows the light or dark theme.
  • Umami (production builds only) and the Google site verification meta.
  • Props tables, now generated at build time from src with react-docgen-typescript, shown as a list (the 5-column table did not fit).
  • Logo, accent color, edit links, and a description for every page (FAQ pages had theirs from the first paragraph in Docusaurus; now it is in their front matter).

Algolia search is replaced by Starlight's built-in Pagefind. The Stack Overflow navbar link is gone (the tag is dead; the README points to the FAQ, the home page to the FAQ and GitHub Discussions).

Checked locally

  • pnpm docs:build from a clean state: 46 pages, astro check 0 errors.
  • All 45 sitemap URLs return 200 with their <h1>. All 17 previews render a painted chart. No internal link lacks the trailing slash. Old /tags/line-chart redirects to /components/line/.
  • Headless Chrome, 1440 px light and dark, 375 px mobile (no horizontal overflow): pages, props list, banner.
  • The editor flow on two example pages: the tab loads, the page reloads isolated, StackBlitz boots and runs the example, the ad still renders, no console errors.
  • Note for local checks: EthicalAds' Cloudflare answers headless Chrome with a 403, so the banner only shows with a regular browser user agent.
  • pnpm test, pnpm oxlint (the website's .ts, .js and .astro files are linted too).

After merging

  • In Search Console, submit https://react-chartjs-2.js.org/sitemap-index.xml and request indexing of the example and component pages.

Stack

  1. chore: agent skills and notes (chore: add agent skills lock and agent notes #1354)
  2. ci: Node.js 26, pnpm 12 and workflows (ci: update Node.js, pnpm and workflows #1355)
  3. build: Vite and Vitest (build: build and test with Vite #1356)
  4. chore: Storybook 10 (chore: update Storybook to 10 #1357)
  5. chore: sandboxes in the root workspace (chore: install the sandboxes from the root workspace #1358)
  6. chore: lint with oxlint (chore: lint with oxlint #1359)
  7. chore(deps): update dependencies (chore(deps): update dependencies #1360)
  8. docs: move the website to Starlight ← this PR
  9. build!: drop the CommonJS build (build!: drop the CommonJS build #1362)

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.97%. Comparing base (620350f) to head (f104440).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1361   +/-   ##
=======================================
  Coverage   93.97%   93.97%           
=======================================
  Files           3        3           
  Lines          83       83           
  Branches       20       20           
=======================================
  Hits           78       78           
  Misses          3        3           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The documentation website is built with Astro and Starlight from the root workspace (pnpm docs:build), keeping every URL of the Docusaurus website; tag pages and the search page redirect to their counterparts.

- Example pages show the code of the example as text next to its live preview, so search engines and agents can read it.
- Pages end with a trailing slash in canonical URLs, the sitemap and internal links, as GitHub Pages serves them, so no link costs a redirect.
- robots.txt points to the sitemap; sitemap.xml still answers at its old address.
- llms.txt, llms-small.txt and llms-full.txt describe the documentation for agents.
- The StackBlitz editor works again: it needs a cross-origin isolated page, and a service worker makes an example page isolated when the editor is asked for.
- Props tables are generated from the sources at build time; the EthicalAds banner and Umami stay.
The links lead straight to the pages, and the FAQ replaces the Stack Overflow link.
Type-aware lint reads the types of astro:content, which astro sync writes to the ignored .astro folder: a fresh install, as in CI, has them now.
An isolated page embeds only isolated frames: the service worker adds the headers to the previews of the examples too, so the Preview tab works next to the editor.
Safari has no credentialless COEP, and the service worker may fail to register where site data is blocked: instead of a useless reload, or a button that does nothing, the editor opens on StackBlitz.
Docusaurus took the description of a page from its first paragraph, Starlight uses the one of the website: each FAQ page has its own description for search results again.
The logo and the favicon answer at /img/ as before.
@dangreen

Copy link
Copy Markdown
Collaborator Author

Replaced by #1367, which now comes after the CommonJS drop (#1366) and also moves the Migration to v6 guide over to Starlight.

@dangreen dangreen closed this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant