Skip to content

website: Keep versioned docs links inside their version - #3243

Merged
huacnlee merged 6 commits into
mainfrom
website/versioned-docs-links
Sep 25, 2026
Merged

huacnlee merged 6 commits into
mainfrom
website/versioned-docs-links

Conversation

@huacnlee

@huacnlee huacnlee commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Documentation pages read under /versions/main or /versions/<tag> linked back to the default version through site-root links (/docs/entity, /component/...), which often 404 there because the default is the latest release.

Links stay in their version

  • 124 site-root links in docs, component, base, shell (en and zh-CN) now link the .md file relatively. zh-CN pages that linked English Base pages now link the Chinese ones.
  • remarkDocLinks prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside /versions/<tag> too.
  • Redirect destinations (/docs/dock → /component/dock, …) and the zh-CN → en language switch kept dropping the version base; both are fixed.
  • The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before.

GPUI snapshot version in one place

Pages write {{gpui_pre_version}} in prose, code and docs.rs links. It resolves from the gpui entry of the workspace Cargo.toml; script/build-website-versions passes each revision's own value. The .md endpoints and llms-full.txt expand it as well.

Maturity labels

maturity: [preview | experimental | showcase-only | platform-dependent | stable] in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable.

Checks

  • bun run test:docs (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned gpui-pre version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match.
  • bun run test:links: every <a> and redirect in a build reaches a built page; test:versioned-examples repeats it at /versions/test/, where leaving the version fails.
  • Test Docs now also runs on Cargo.toml changes.

Verified locally with a production-shaped build (v0.6.6 at /, this branch at /versions/main): all website tests pass, the v0.6.6 snapshot passes the link check at /versions/v0.6.6/, and the 404 fallback works for /docs/entity and /zh-CN/docs/entity.

Publishing a release that contains the new GPUI guides is what makes /docs/ show them; this PR does not change which version is the default.

🤖 Generated with Claude Code

huacnlee and others added 6 commits September 26, 2026 00:28
- Link documentation pages with relative `.md` paths; the build also moves
  site-root links from released snapshots into the version being built.
- Keep redirects and the zh-CN → en language switch below the version base.
- On a 404, offer the same page from another version, and style the page.
- Write the GPUI snapshot version as `{{gpui_pre_version}}`, resolved from
  the workspace `Cargo.toml` of the documented revision.
- Add `maturity` frontmatter (Stable, Preview, Experimental,
  Platform-dependent) with labels under the title and definitions on the
  documentation home.
- Check sources (`test:docs`) and built links (`test:links`) in CI.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… target

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@huacnlee
huacnlee enabled auto-merge (squash) September 25, 2026 16:47
@huacnlee
huacnlee disabled auto-merge September 25, 2026 16:48
@huacnlee
huacnlee merged commit f8cd486 into main Sep 25, 2026
12 checks passed
@huacnlee
huacnlee deleted the website/versioned-docs-links branch September 25, 2026 16:48
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