Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

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

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

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.

display-namestringRequired
Name shown in the version selector.
pathstringRequired
Version navigation file.
slugstring
URL segment and version id; generated from display-name by default.
availabilitystable | ga | beta | deprecated
Status badge in the selector.
hiddenboolean
Not listed in the selector, but pages are still built and reachable by URL (useful for private betas).

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:

VersionPageURL
v1 (default)Quickstart/guides/get-started/quickstart
v0Quickstart/v0/guides/get-started/quickstart
v1, EnglishQuickstart/en/guides/get-started/quickstart
v0, EnglishQuickstart/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 (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/).

OutputWhich versions
Page HTML and .mdAll versions
sitemap.xmlAll versions (except noindex pages)
llms.txtThe 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 indexDefault 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:

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:

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.

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.

Commit and publish

Click Commit, then choose Publish to production in the dialog that follows.

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