Skip to content

bug: version selector does not work with recent change (insiders) #2929

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

Closed
5 tasks done
dmccaffery opened this issue Aug 11, 2021 · 4 comments
Closed
5 tasks done

bug: version selector does not work with recent change (insiders) #2929

dmccaffery opened this issue Aug 11, 2021 · 4 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@dmccaffery
Copy link

Contribution guidelines

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

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

The following change breaks the version selector as the URL for versions.json now resolves within the version directory /v1.0.0/versions.json instead of the root of the host /versions.json.

https://github.com/squidfunk/mkdocs-material-insiders/blame/f80b15d5805d37428307cf7f9eebf1ef3275b47a/src/assets/javascripts/_/index.ts#L105

Expected behaviour

The version selector should work as the versions.json should be retrieved from the root instead of the version-specific path.

Actual behaviour

The version selector does not work as the attempt to retrieve the versions.json file fails.

Steps to reproduce

  1. mike deploy v1.0.0
  2. mike deploy v2.0.0
  3. mike serve

Package versions

  • Python: 3.9.6
  • MkDocs: mkdocs, version 1.2.2
  • Material: 7.2.3+insiders.2.13.0

Configuration

extra:
  version:
    provider: mike

System information

  • Operating system: macOS Monterey Beta 4
  • Browser: Safari
@squidfunk
Copy link
Owner

Thanks for reporting. I'll investigate this asap.

Background for this change: MkDocs changed how the documentation is served locally. As of version 1.2.2, MkDocs always prepends the path of the site_url, e.g. for asite_url of squidfunk.github.io/mkdocs-material/ the serve URL is localhost:8000/mkdocs-material/. Previously, this was localhost:8000. This led to the necessity of the change, but versions should clearly continue working.

Does this also happen with the non-Insiders version?

@squidfunk squidfunk added the bug Issue reports a bug label Aug 11, 2021
@squidfunk
Copy link
Owner

Thanks again for reporting. As I explained, it was due to a MkDocs change that had some unanticipated consequences. The community edition was also affected, and it was fixed in a855133 and a4ccbbb. Insiders had some more trouble with the "stay on page while switching versions" behavior, which were also fixed. I'll issue a release of both editions in a few minutes.

I'm sorry that this was causing you trouble.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Aug 11, 2021
@squidfunk
Copy link
Owner

squidfunk commented Aug 11, 2021

Released as part of 7.2.4 in both, the community edition and Insiders.

@dmccaffery
Copy link
Author

Thanks for the quick fix. I was able to work around it locally; the bug was more of an FYI as I was sure it was affecting others.

I was going to create a PR myself, time permitting, but you beat me to it!

This project is awesome. All of your hard work is greatly appreciated.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants