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

Is it possible to remove the version dropdown for one single page? #116

Closed kayleejacques closed 1 year ago

kayleejacques commented 1 year ago

Good day! I'm just wondering if there's a way to override the version drop down so that it will not show up for one page that is build using Mike

Background: We have a mono repo and are now using mike to manage the versioning. We build each module into its own folder with the help of --prefix. Therefore, we have multiple folders in gh-pages that have their own versions. Each module page works as it should be and we now have document versioning for each module.

Problem: The problem we have is that we also have a root mkdocs.yml file that all the modules mkdocs.yml files inherit from to build a homepage. Therefore, we do not want to have version for this generic homepage. However, if we use native mkdocs to build the page, upon running mkdocs gh-deploy it will wipe out the existing content of gh-pages which means it removes all of the modules folders we build using mike. We worked around this issue by using mike to build the root mkdocs.yml so we could store this generic content in its one folder in gh-pages. But it also means that we now have versioning for this generic page as well. That said, would this be possible to remove the version drop down for this generic page? I see that overrides header.html is an option but I'm not sure where to start. Any pointers would be much appreciated.

jimporter commented 1 year ago

The easiest way to do this would probably be to use mkdocs gh-deploy --dirty, though that would mean you might have to clean up stale pages from your unversioned docs. Alternately, you can set plugins.mike.version_selector to false: https://github.com/jimporter/mike#usage. (If you're using the Material theme, this might work differently. I'm not sure how/if they support this, but maybe their docs have something useful.)

kayleejacques commented 1 year ago

Thank you so much for your quick response. I tried the verion_selector but unfortunately, it did nothing. and yes, I'm using material theme. I was not aware of this --dirty option. I will do some research and give it a try! Thanks again!