-
Notifications
You must be signed in to change notification settings - Fork 331
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
The version switcher looks for json_url
in an incorrect location when arbitrary static paths are used
#1389
Comments
Even when using Giving the absolute path |
From the documentation (first sentence of this section):
However later in that same section we say:
...which is probably what led you all to think that this would work. I think we should remove (or change wording of) that bullet. There may indeed be something wrong with how we're handling |
Description
A local
JSON
file located in a source inhtml_static_path
supplied with the version switcher options will be found by the theme upon building the documentation in said path, butjson_url
will return a 404 status code upon accessing the built documentation, which will break the version switcher.As discussed with @drammock, this is likely related to #1385 and #1328.
Minimal working example
In
conf.py
and in
versions.json
The theme is able to find the
versions.json
file without issues since it does not display a warning. The issue arises when the documentation is built and accessed, wherein there is a mismatch; it tries to find the switcher athttps://localhost:8000/abc/xyz/_static/versions.json
and fails, thereby causing the dropdown to not load, while Sphinx copies over the static file athttps://localhost:8000/_static/versions.json
.Apparently, the switcher will work fine for most users since the standard path is set to
docs/_static/
, which means that the theme will be able to find thejson_url
athttps://localhost:8000/_static/versions.json
without issues. The intended functionality is that for arbitrary static paths set inhtml_static_path
, it should still look at the same link instead of appending the path to the static folder in the URL (i.e., at_static/versions.json
instead ofabc/xyz/_static/versions.json
).Footnotes
xref: pybamm-team/PyBaMM#3108
The text was updated successfully, but these errors were encountered: