Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hidden versions #151

Closed
jasonnovichRunAI opened this issue Apr 9, 2023 · 6 comments
Closed

Hidden versions #151

jasonnovichRunAI opened this issue Apr 9, 2023 · 6 comments

Comments

@jasonnovichRunAI
Copy link

jasonnovichRunAI commented Apr 9, 2023

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
Copy link
Author

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

@gabrielbdornas
Copy link

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
Copy link
Owner

@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
Copy link

@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
Copy link
Owner

@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
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants