mike is a Python utility designed to simplify the deployment of multiple versions of your MkDocs-powered documentation to a Git branch, commonly `gh-pages`. This approach allows you to archive older documentation versions, ensuring they remain accessible even if future MkDocs updates introduce breaking changes. The current version is 2.1.4, with a release cadence that includes frequent bug fixes and less frequent but consistent minor/major feature releases.
pip install mikeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the core `mike` commands for setting up, deploying, and serving versioned MkDocs documentation. It includes creating a new MkDocs project, deploying initial versions with aliases, setting a default version, and viewing the documentation locally.
If relying on the old behavior, explicitly specify `--alias-type copy` in CLI commands or `alias_type: copy` in the `mike` plugin configuration in `mkdocs.yml`. To allow empty commits, add `--allow-empty` to `mike deploy` commands.
Upgrade to `mike>=2.1.0` to ensure proper execution of MkDocs' `startup` and `shutdown` events.
Ensure `mike>=2.1.1` is installed if you are using `INHERIT` directives with environment variables in your `mkdocs.yml` file.
Be mindful of which command you use for local testing: `mkdocs serve` for local source changes, `mike serve` for deployed (Git) branch content. For live sites, use a proper web server, not `mike serve` or `mkdocs serve`.