Skip to content

Commit

Permalink
Updated versioning documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Oct 25, 2020
1 parent cab5693 commit d9e3c5c
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions docs/setup/setting-up-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ project:
[![Versioning][3]][3]
_Note that you don't need to run `mike install-extras` as noted in the
[official documentation][4], as [mike][1] is now natively integrated with
Material for MkDocs._
[Try this feature][4]{: .md-button .md-button--primary }
_This feature is enabled in the [versioning example][4] built with
Insiders. Click the button to go to Material for MkDocs Insiders and give this
feature a try._
!!! quote "[Why use mike?][5]"
Expand All @@ -52,46 +54,49 @@ Material for MkDocs._
to particularly notable versions. This makes it easy to make permalinks to
whatever version of the documentation you want to direct people to.

_Note that you don't need to run `mike install-extras` as noted in the
[official documentation][6], as [mike][1] is now natively integrated with
Material for MkDocs._

[2]: ../insiders.md
[3]: ../assets/screenshots/versioning.png
[4]: https://github.com/jimporter/mike#usage
[4]: https://squidfunk.github.io/mkdocs-material-example-versioning/
[5]: https://github.com/jimporter/mike#why-use-mike
[6]: https://github.com/jimporter/mike#usage

## Usage

While this section outlines the basic workflow for publishing new versions,
it's best to check out the [official documentation][4] to make yourself familar
with [mike][1].

### Setting a default version

When starting with [mike][1], a good idea is to set an alias as a default
version, e.g. `latest`, and when publishing a new version, always update the
alias to point to the latest version:

```
mike set-default latest
```

When publishing a new version, [mike][1] will create a redirect in the root of
your project documentation to the version associated with the alias:

_docs.example.com_ :octicons-arrow-right-24: _docs.example.com/0.1_

### Publishing a new version

If you want to publish a new version of your project documentation, choose a new
If you want to publish a new version of your project documentation, choose a
version identifier and update the alias set as the default version with:

```
mike deploy --push --update-aliases 0.2 latest
mike deploy --push --update-aliases 0.1 latest
```

_docs.example.com_ :octicons-arrow-right-24: _docs.example.com/0.2_

Note that every version will be deployed as a subdirectory of your `site_url`,
e.g.:

- _docs.example.com/0.1_
- _docs.example.com/0.2_
- ...

### Setting a default version

When starting with [mike][1], a good idea is to set an alias as a default
version, e.g. `latest`, and when publishing a new version, always update the
alias to point to the latest version:

```
mike set-default --push latest
```

When publishing a new version, [mike][1] will create a redirect in the root of
your project documentation to the version associated with the alias:

_docs.example.com_ :octicons-arrow-right-24: _docs.example.com/0.1_

0 comments on commit d9e3c5c

Please sign in to comment.