---
title: Versions
subtitle: 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.
description: Configure versioned docs in ButterIX — the versions field, version navigation files, URL prefixes, the version switcher, same-page switching rules, canonical for older versions, availability and hidden, products × versions, and the in-page Versions component.
---

<Tip>
  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.
</Tip>

## Configuration

```yaml title="docs.yml"
versions:
  - display-name: v1 (current)
    path: versions/v1.yml
    slug: v1
    availability: stable
  - display-name: v0 (legacy)
    path: versions/v0.yml
    slug: v0
    availability: deprecated
```

Each 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`):

```yaml title="versions/v0.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: quickstart
```

Once `versions` is configured, the `navigation` in `docs.yml` is no longer used.

<ParamField path="display-name" type="string" required>Name shown in the version selector.</ParamField>
<ParamField path="path" type="string" required>Version navigation file.</ParamField>
<ParamField path="slug" type="string">URL segment and version id; generated from `display-name` by default.</ParamField>
<ParamField path="availability" type="stable | ga | beta | deprecated">Status badge in the selector.</ParamField>
<ParamField path="hidden" type="boolean">Not listed in the selector, but pages are still built and reachable by URL (useful for private betas).</ParamField>

## 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](../configuration/docs-yml.mdx#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 (a `canonical-url` set 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:

```yaml title="docs.yml"
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.yml
```

The 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:

<Steps>
  <Step title="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.
  </Step>
  <Step title="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.
  </Step>
  <Step title="Edit a version's navigation">
    Switch to the version in the **Viewing version** dropdown above the navigation tree, and its navigation becomes editable just like the default's: drag to reorder, add or remove sections and pages, create pages. A new version shares page files with the version it was copied from; to fork a page, copy it and point the new version's navigation at the copy.
  </Step>
  <Step title="Commit and publish">
    Click **Commit**, then choose **Publish to production** in the dialog that follows.
  </Step>
</Steps>

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:

````mdx
<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>
````

<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>

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>`](../writing/snippets.mdx#conditional-content).
