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

Hidden versions #151

Closed jasonnovichRunAI closed 1 year ago

jasonnovichRunAI commented 1 year ago

Hi, I am currently using Mike to deploy multiple versions of my MKDocs via gh-pages and manually triggered github actions. It seems to be working well, but Iam having an issue with "hiding" versions. What I am looking to do, is add a version to the documentation site that can only be accessed knowing the URL and not via the drop down. For example:

Drop down : URL 1 : https://some.custom.url/v1 2: https://some custom.url/v2 no menu entry : https://some.custom.url/v3

For each of the versions above I have a branch in my repo that I deploy from. My github action takes varios different inputs and builds the docs based on the branch, alias, and menu title I input. This way I can rebuild if there are updates to older branches. Each branch has its own mkdocs.yml file for me to make customizations to. I am trying to use version_selector: false in v3 for the build, and have it hiddent from the menu. This does not seem to be working.

I am sure Iam doing something wrong. Any advice?

Thanks, Jason

jasonnovichRunAI commented 1 year ago

Solved the issue, was not fetching out of the gh-pages in the correct step in the CI.

gabrielbdornas commented 9 months ago

Solved the issue, was not fetching out of the gh-pages in the correct step in the CI.

Hello @jasonnovichRunAI, It looks like I'm having the same issue you experienced. Unfortunately, I didn't understand how you solved the problem. Would you mind helping me?

I configured my mkdocs.yml file as suggested here:

# mkdocs.yml
site_name: My Docs
theme:
  name: material
  custom_dir: overrides
extra:
  version:
    provider: mike
plugins:
  - mike:
      version_selector: false

And then ran mike deploy 0.1, mike deploy 0.2 latest and mike set-default latest (I'm running just locally at first).

But, as I said, the mike serve shows the selector:

image

Thanks in advance.

jimporter commented 9 months ago

@gabrielbdornas This isn't an issue with mike, but rather that the Material theme doesn't (as far as I know) consult the version_selector property. You should ask over at https://github.com/squidfunk/mkdocs-material

gabrielbdornas commented 9 months ago

@gabrielbdornas This isn't an issue with mike, but rather that the Material theme doesn't (as far as I know) consult the version_selector property. You should ask over at https://github.com/squidfunk/mkdocs-material

@jimporter, you are totally right! I changed the theme to mkocs rebuilt the versions and the selector was gone.

Appreciate for your time.

jimporter commented 9 months ago

@gabrielbdornas You might also be interested in the hidden version property (also only supported in the mkdocs and readthedocs themes as far as I know): it lets you hide a specific version from the dropdown, rather than hiding the dropdown entirely. The README discusses how to set properties, but the short version is that you could do something like mike prop <some-version> --set hidden=true to set the property.

gabrielbdornas commented 9 months ago

@jimporter, just to let you know that after contacting the material's owners, the version_selector was included within the theme. Thank you so much to help me to clarify which was the question and how to solve it.