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

Version selector missing #2347

Closed
5 tasks done
aratare-jp opened this issue Feb 25, 2021 · 15 comments · Fixed by aws/jsii#2693, hacf-fr/awesome-francophone-home-assistant#106 or JosephMontoya-TRI/BEEP#3
Closed
5 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@aratare-jp
Copy link

I've found a bug and checked that ...

  • ... the problem doesn't occur with the default MkDocs template
  • ... the problem is not in any of my customizations (CSS, JS, template)
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Hi there. I'm following https://github.com/squidfunk/mkdocs-material-example-versioning and it seems that I can't create the version selector like stated in the doc.

image

Expected behavior

There should be a version selector.

Actual behavior

There is none.

Steps to reproduce the bug

pip install mike
git clone https://github.com/squidfunk/mkdocs-material-example-versioning.git`
cd mkdocs-material-example-versioning
mike deploy --update-aliases 0.1 latest
mike set-default latest
mike deploy --update-aliases 0.2 latest
mike serve
# or
mkdocs serve

Package versions

  • Python: 3.9.1
  • MkDocs: 1.1.2
  • Material: 6.2.8

Project configuration

# Project information
site_name: My Docs
site_url: https://squidfunk.github.io/mkdocs-material-example-versioning/
site_author: Martin Donath

# Repository
repo_name: squidfunk/mkdocs-material-example-versioning
repo_url: https://github.com/squidfunk/mkdocs-material-example-versioning
edit_uri: ""

# Configuration
theme:
  name: material

# Customization
extra:
  version:
    method: mike

System information

  • OS: Windows 10
  • Browser: Chrome
@squidfunk
Copy link
Owner

squidfunk commented Feb 25, 2021

Thanks for reporting! The README wasn't up to date, so it's probably related to the fact that method was renamed to provider:

Before:

extra:
  version:
    method: mike

Now:

extra:
  version:
    provider: mike

I also updated the documentation in the linked repo to reflect that change.

@aratare-jp
Copy link
Author

Hi there. Thanks a lot for getting back so quickly :)

So I've also tried provider, and it still does not show the selector. I've nuked everything and recloned and gone through the whole process again with the new provider key and no luck so far.

@squidfunk
Copy link
Owner

Thanks for checking. Indeed. The path to versions.json seems corrupt:

GET https://squidfunk.github.io/versions.json 404

I'll investigate.

@squidfunk squidfunk added the bug Issue reports a bug label Feb 25, 2021
@squidfunk
Copy link
Owner

squidfunk commented Feb 25, 2021

Fixed in f40112e – the version selector URL was not correct. Thanks again for reporting, so we can flesh out those bugs stemming from the major rewrite so quickly 😊 The versioning example is redeployed with the latest maste and working fine. I'll issue 7.0.2 later this day which will contain the fix.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Feb 25, 2021
@aratare-jp
Copy link
Author

Thanks a lot @squidfunk! You just made my day 😃 I'll close this issue now.

This was referenced Mar 8, 2021
This was referenced Mar 15, 2021
@Skier23
Copy link

Skier23 commented Sep 1, 2022

@squidfunk I'm having the same bug in 8.4.2 in the newest release.

@squidfunk
Copy link
Owner

@Skier23 can't reproduce. If I follow the steps in https://github.com/squidfunk/mkdocs-material-example-versioning, everything works as expected. I just redeployed it with 8.4.2:

Bildschirmfoto 2022-09-01 um 15 50 24

@Skier23
Copy link

Skier23 commented Sep 1, 2022

I'm getting these errors in the console as well:
127.0.0.1 - - [01/Sep/2022 09:16:22] code 404, message File not found
127.0.0.1 - - [01/Sep/2022 09:16:22] "GET /livereload/865877890/865878312 HTTP/1.1" 404 -

@squidfunk
Copy link
Owner

Again, I'm not able to reproduce it. Please check your setup and environment, and make sure that mike is up to date. If it doesn't work nonetheless, please provide a minimal self-contained reproducible example, which I can look into. Without an example that I can run, I'm not able to help 😅

@jonasbirkelof
Copy link

I have kinda the same issue running mike 1.1.2 and material 8.5.6 and I have followed every step on the material site and mike's own site. To push a version with an alias to GitHub works fine and a subfolder with the version is uploaded.

If i go to my site https://site.github.io/docs there is no version dropdown, but when I go to https://site.github.io/docs/0.1/ or https://site.github.io/docs/latest/ there is!

There seems to be something (not) going on with the redirect when you don't pass a version or alias in the url.

@squidfunk, can I do something to fix this? If you navigate to https://site.github.io/docs/ you should be redirected to /latest.

@squidfunk
Copy link
Owner

squidfunk commented Oct 28, 2022

This sounds like a caching issue. As you can see from our versioning example, the index.html at the root of your documentation should just be a small HTML file with a redirect to latest. It's a better idea to ask the maintainer of mike.

@jonasbirkelof
Copy link

Well, you were right sir! :) Tried another browser and it worked fine. I don't have any issue then. :) Thanks!

@squidfunk
Copy link
Owner

Glad I could help.

@jonasbirkelof
Copy link

Sorry I have to bring this up again, but the reason it worked was because I had some old files in my root folder. The index.html file that you refered to does not exist in my gh-pages branch and is not deployed by mike. Is this an error from my side or has it something to do with mike?

@jonasbirkelof
Copy link

After some more searching I found the setting in the mike documentation. You have to run the mike set-default latest command prior to deploy to create the index.html file! In other words, it has nothing to do with Materials.

https://github.com/jimporter/mike#setting-the-default-version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment