pydata-sphinx-theme
pydata-sphinx-theme copied to clipboard
fix: check the json switcher file
When adding a json switcher using an url I added a few test on the file itself to make sure it's not malformed in order to help developer track down bugs.
Fix #901
sorry for the noise, some of the errors where only occuring in the github build.
Some explanations:
- checking if there is a json-url key
- check that there is a version key
- find the file using request if the file is distant and read it from the source folder if it's a local one
- check the content of the switcher file and make sure that all elements have a "url" and "version" key
- if anything goes wrong raise an error