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

alias VS set-default #147

Closed karl-johan-grahn closed 1 year ago

karl-johan-grahn commented 1 year ago
$ mike alias main main
$ mike set-default main
error: duplicated version and alias

Is this as expected? Will alias automatically set-default too? Or should set-default be set first, and then alias? Or is set-default redundant if alias is set?

karl-johan-grahn commented 1 year ago
$ mike list
error: duplicated version and alias
$ mike list main
error: duplicated version and alias
$ mike delete main
error: duplicated version and alias
jimporter commented 1 year ago

You shouldn't set an alias to itself. That's like having a symlink that points to itself.

karl-johan-grahn commented 1 year ago

It gets you into a loophope where you have to manually update the versions.json on the gh-pages branch. The alias is needed for the version warning https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/#version-warning

Would be worth implementing a check so alias cannot be set to the same as the version.

jimporter commented 1 year ago

You shouldn't need to manually update; you can just revert the bad commit. That would be cleaner, and less-likely to produce longer-term issues.