1. Home
  2. ChevronRightGlobalization
  3. ChevronRightVersioning

Versioning

Maintain multiple versions of your documentation side by side using folder conventions and the versions config key.

Versioning lets you keep multiple parallel editions of your documentation live at the same time — one for each major release of your project. Users can switch between them, and older versions remain accessible without any manual maintenance.


How It WorksLink

Like locales, versions are folder-based. Each version lives in a subfolder at the root of docs/. Boltdocs maps those folders to versioned URL prefixes.

docs/
├── index.md            → /docs/guide (default / current version)
├── guide/
│   └── index.md        → /docs/guide
└── v1/
    └── guide/
        └── index.md    → /docs/v1/guide

Quick StartLink

Step 1: Add versions to your configLink

export default defineConfig({
  versions: {
    defaultVersion: 'v2',
    versions: [
      { label: 'v2 (latest)', path: 'v2' },
      { label: 'v1',          path: 'v1' },
    ],
  },
})

Step 2: Create version foldersLink

mkdir docs/v2 docs/v1

Step 3: Add your versioned contentLink

docs/
├── v2/
│   ├── guide/
│   │   └── index.md    → /docs/v2/guide
│   └── api/
│       └── config.md   → /docs/v2/api/config
└── v1/
    └── guide/
        └── index.md    → /docs/v1/guide

Config ReferenceLink

BoltdocsVersionsConfigLink

PropertyTypeRequiredDescription
defaultVersionstringThe version path that is considered the current/default. Pages for this version don't necessarily need their own folder if you want them at the root.
prefixstringA string prepended to every version's path inside docs/ (e.g., 'v' → folders become docs/v1/, docs/v2/).
versionsVersionConfig[]The ordered list of available versions. First item appears first in version switcher.

VersionConfigLink

PropertyTypeRequiredDescription
labelstringHuman-readable label for this version (e.g., 'v2 (latest)'). Displayed in the version switcher UI.
pathstringThe folder name in docs/ and the URL segment for this version (e.g., 'v1').

Using a Folder PrefixLink

If you want all version folders to share a common prefix (e.g., docs/releases/v1/, docs/releases/v2/), set the prefix option:

export default defineConfig({
  versions: {
    defaultVersion: 'v2',
    prefix: 'releases/',
    versions: [
      { label: 'v2 (latest)', path: 'v2' },
      { label: 'v1',          path: 'v1' },
    ],
  },
})

This maps docs/releases/v2/guide.md/docs/releases/v2/guide.


Combining Versioning with i18nLink

When both versioning and i18n are active, the folder hierarchy is always version first, then locale:

docs/
└── v2/
    ├── guide.md         → /docs/v2/guide      (default locale)
    └── es/
        └── guide.md     → /docs/v2/es/guide   (Spanish)
AlertTriangle
Order matters

The version segment is always resolved before the locale segment. Place locale folders inside version folders, not the other way around. The reverse structure (docs/es/v2/) is not supported.


Versioned URLsLink

Given this config:

versions: {
  defaultVersion: 'v2',
  versions: [
    { label: 'v2', path: 'v2' },
    { label: 'v1', path: 'v1' },
  ],
}

A file at docs/v1/guide/install.md resolves to /docs/v1/guide/install. A file at docs/v2/guide/install.md resolves to /docs/v2/guide/install.

The version switcher in the default layout lets users jump between versions while staying on the equivalent page.

Last updated on July 27, 2026

Was this page helpful?