Mike Configuration¶
Configure MkDocs Material with mike for multi-version documentation hosting.
Prerequisites¶
Install dependencies:
Or in requirements.txt:
MkDocs Configuration¶
Add version provider to mkdocs.yml:
site_name: My Project
site_url: https://my-project.example.com
extra:
version:
provider: mike
default: latest
The default: latest setting redirects the root URL to the latest alias.
Version Selector¶
MkDocs Material automatically adds a version selector dropdown when it detects mike's versions.json file. No additional configuration required.
Local Development¶
Single Version¶
Standard development server (no versioning):
Multi-Version Preview¶
Preview the versioned site locally:
First-Time Setup
Mike stores versions in the gh-pages branch. For a new project,
you need at least one deployed version before mike serve works.
Directory Structure¶
Mike expects standard MkDocs layout:
No special directories needed. Mike manages versions in the deployment target (gh-pages branch), not the source repository.
Version JSON¶
Mike generates versions.json at the site root:
[
{"version": "1.2.3", "title": "1.2.3", "aliases": ["v1", "latest"]},
{"version": "1.1.0", "title": "1.1.0", "aliases": []},
{"version": "dev", "title": "dev", "aliases": []}
]
MkDocs Material reads this to populate the version selector.
Related¶
- Pipeline Integration - CI/CD workflow setup
- Version Strategies - Aliasing patterns
- MkDocs Material Documentation - Theme reference