astropy-tutorials
astropy-tutorials copied to clipboard
Try downloading searchindex.js directly from astropy.org to get around cross-origin AJAX issues
The way Sphinx search works is by generating a pure-javascript index file (searchindex.js) that is then called by various javascript code (in searchtools.js). Right now, the AJAX call to query the astropy documentation as a part of the main search bar fails because it requires a cross-origin AJAX request (blocked by default in most browsers). But it occurred to me that we could just download and cache the astropy docs searchindex.js file as a part of the pre-processing done to prepare the sphinx build, thereby making it a local file! We should prototype this and see if it works as expected.
cc @eteq @MananAgarwal
I'm 👍 to this idea, particularly because I think if we do this right #305 might be made easier by doing a similar trick with cleverly-chosen search terms.