jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
528 stars 47 forks source link

Support versioning when switching from non-MkDocs content #110

Closed jponge closed 2 years ago

jponge commented 2 years ago

This follows the discussion in https://github.com/squidfunk/mkdocs-material/discussions/4097.

I have a case where I'm migrating from a non-MkDocs website built with Jekyll to MkDocs with mike versioning.

It'd be useful for such cases to have a way to version the legacy content then move the root gh-pages (or whatever the branch is) to a mike-compliant structure.

In tests I found that mike simply adds its own files to an existing tree, but will not override any existing index.html for instance.

jimporter commented 2 years ago

That's already possible. Just check out your gh-pages branch locally, move the files into the directory structure you'd like, and create a versions.json file with a definition for that version. Then you can use mike as normal.

The README has an example versions.json that you can use as a basis for creating your initial one: https://github.com/jimporter/mike#for-theme-authors