Versions
Maintain separate navigation for each version with a version switcher in the header; older versions automatically point canonical to the current version so duplicate content doesn't hurt SEO.
This site has two versions. Open the version selector to the right of the header logo and switch to "v0", then look at the <link rel="canonical" /> in the page source — it points to the same page in v1.
Configuration
versions:
- display-name: v1 (current)
path: versions/v1.yml
slug: v1
availability: stable
- display-name: v0 (legacy)
path: versions/v0.yml
slug: v0
availability: deprecatedEach version's navigation lives in its own file, in the same format as the navigation part of docs.yml, and can carry its own tabs (merged with the tabs in docs.yml):
navigation:
- tab: guides
layout:
- section: Get started
slug: get-started
contents:
- page: Introduction
path: pages/v0/introduction.mdx
slug: introduction
- page: Quickstart
path: pages/v0/quickstart.mdx
slug: quickstartOnce versions is configured, the navigation in docs.yml is no longer used.
URLs
The first version in the list is the default version and has no version prefix in its URLs; other versions use a /<slug> prefix:
| Version | Page | URL |
|---|---|---|
| v1 (default) | Quickstart | /guides/get-started/quickstart |
| v0 | Quickstart | /v0/guides/get-started/quickstart |
| v1, English | Quickstart | /en/guides/get-started/quickstart |
| v0, English | Quickstart | /en/v0/guides/get-started/quickstart |
When you release a new version, put it first in the list to make it the default; the previous default automatically gets a prefix. If external links point to the old URLs, remember to add redirects.
Matching the same page across versions
The builder identifies the same page by "tab id + section title + page title". Pages with the same path in two versions are linked:
- The version switcher jumps straight to the same page in the other version; if that version doesn't have the page, it goes to that version's home page.
- An older version page's
<link rel="canonical" />points to the same page in the default version (acanonical-urlset in the page frontmatter takes precedence).
So keep a page's navigation title the same across versions, even if the file paths differ (this site keeps its v0 pages under pages/v0/).
Versions, AI, and search
| Output | Which versions |
|---|---|
Page HTML and .md | All versions |
sitemap.xml | All versions (except noindex pages) |
llms.txt | The root and each language: default version only; other versions and products each have their own, such as /v0/llms.txt |
| Ask AI and MCP search index | Default version only |
This way AI answers only cite current-version content, while older versions remain available to readers who need them.
Products × versions
With multiple products, versions go under each product:
products:
- display-name: Server API
slug: api
versions:
- display-name: "2026-10"
path: products/api/2026-10.yml
- display-name: "2025-04"
path: products/api/2025-04.yml
- display-name: Android SDK
slug: android
path: products/android.ymlThe URL prefix is the product segment followed by the version segment, for example /api/2025-04/…. The header shows both a product selector and a version selector.
Manage versions in the console
You don't have to write version files by hand; the editor handles it:
Turn on versions
Open the editor, go to Docs settings → Navigation, and under Versions click Turn on versions. Enter a name for the current content's version (such as v1) and for the new version (such as v2). The navigation in docs.yml moves to versions/v1.yml, and the new version starts with a copy in versions/v2.yml. Skip this step if the site already has versions.
Add and adjust versions
Add creates a version by copying the navigation of any existing one. Each version's name, URL segment and status (stable / beta / deprecated) can be changed, and its ⋯ menu makes it the default, reorders it, hides it from the switcher or deletes it. The first version is the default; before you change it, the editor explains which URLs will change.
On multi-product sites, versions belong to each product (products[].versions) and are edited in docs.yml for now; you can still switch products and versions above the navigation tree to edit each navigation.
In-page versions: the Versions component
When only a small piece of content changes between versions, there's no need to duplicate the whole navigation — use <Versions> to switch within the page:
<Versions>
<Version version="v2" title="SDK v2 (current)" default>
```ts
const payment = await acme.payments.create({ amount: 1999, currency: "cny" });
```
</Version>
<Version version="v1" title="SDK v1">
```ts
const payment = await acme.createPayment(1999, "cny");
```
</Version>
</Versions>SDK v2 (current)
const payment = await acme.payments.create({ amount: 1999, currency: "cny" });const payment = await acme.createPayment(1999, "cny");The selected version is stored in the URL's ?v= parameter, so it's easy to share. To show content based on the site version (rather than an in-page choice), use <If versions>.