mkdocs-deploy began as a drop-in replacement for mike. The main goal is to provide a deployment tool that is version aware and plugable, capable of deploying multiple versions side by side to any target website.
Start by configuring your project
Build your project with mkdocs.
mkdocs buildTo deploy this site somewhere (let's say version 1.0 will live locally at /media/my_site/all_versions/1.0):
mkdocs-deploy deploy 1.0You can give each version a name that might appear in your theme:
mkdocs-deploy deploy 1.0 "First Version"You can add extra aliases. Eg: make 1.x forward to 1.0. Aliases can always be set to something different.
mkdocs-deploy set-alias 1.0 1.xAliases can be set implicitly every time you deploy a new version. Unless otherwise configured every deployment
implicitly replaces the latest alias.
Configure mkdocs-deploy in your project. Then...
# Deploy your first version
mkdocs-deploy deploy "1.0"
# If make sure you have at least one "latest".
mkdocs-deploy set-alias 1.0 latest
# Set the default version for your site. Setting it to alias means it will change when latest changes
mkdocs-deploy set-- Deploy your first version.
- Set a
latestversion - Set a default version, in most cases this should be
latest
- Reading sites from local filesystem: as zip, tar, or directory of files.
- Site on Local file system
- S3 Static site
- HTML file redirects
- S3 redirects
The Material is compatible with versioning by mkdocs-deploy
To enable your material themed mkdocs to understand mkdocs-deploy versioning add the following section to
your mkdocs.yaml file.
extra:
version:
provider: mikeMkdocs-deploy generates a mike compatible file which themese can use named versions.json. Looking something like this:
[
{
"version_id": "1.0",
"title": "1.0",
"aliases": ["latest"]
}
]mkdocs-deploy maintains a file deployments.json:
{
"versions": {
"1.0": {
"title": "First Release"
}
},
"aliases": {
"latest": {
"version_id": "1.0",
"redirect_mechanisms": ["html"]
}
}
}Note that this may be extended in future but mkdocks-deploy will endevour to ensure at least these keys are present.
The redirect_mechanisms available will depend on plugins installed and proboally should be ignored by theme
developers.
mike is very good if you are looking for a simple too for deploying multiple versions of docs to github pages from the command line.
mkdocs-deploy was designed to fill in a few places where mike is weaker:
- Easier to work with best-practice CI pipeline
- Does not require working on two branches at the same time
- Separates build from deployment / publishing
- Better suited to maintaining sites other than Github Pages
- (Future enhancement) Better suited to gitops
- Plugable designed to allow better integration with other tools