The purpose of mike is to deploy multiple versions of your documentation, that won't be touched anymore.
Using mike is relevant only if you deploy docs through a branch (default to gh-pages) as it uses git mechanisms in backstage.
When using mike to deploy docs, the shadcn theme automatically adds a version switcher in the top bar.
Installation
pip install mike
uv add mike
poetry add mike
Configuration
You can include the mike plugin but it is automatically injected when using the mike command (like mike deploy for example).
# mkdocs.yml
plugins:
- mike
Examples
Add version to documentation site
This creates a branch in the documentation branch, maned after <version> tag and aliased latest.
mike deploy --branch <branch_name> --update-aliases <version> latest
Define default doc version
This should be done once per documentation branch. It defines the doc version aliased as latest to be the landing page of the documentation site.
mike set-default --branch <branch_name> latest