Versioning
DocsLit supports multi-version documentation using git branches. Each version maps to a branch, and readers can switch between versions using a dropdown in the site header.
How it works
DocsLit's versioning is branch-based. Each version of your documentation lives on a separate git branch. When you build the site, DocsLit checks out each branch and builds the pages for that version.
Configuration
Add a versions object to your docslit.json:
0.2, 1.0, 2.0).
Latest, Beta, LTS).
Recommended workflow
main branch. This always represents the latest version.
When you release a new version of your product, create a branch from main:
On main, update docslit.json to add the new frozen version and point main to the next version:
docslit build. DocsLit checks out each branch and builds only the pages that changed between versions.
Build output
Versioned builds produce a directory structure with each version in its own folder:
The root index.html redirects to the default version. Only pages that differ between versions are rebuilt — unchanged pages are shared to keep build times fast.
Version-specific content
Use wc-versions to show different content depending on the selected version. See data display for details.