astropy-tutorials icon indicating copy to clipboard operation
astropy-tutorials copied to clipboard

Try downloading searchindex.js directly from astropy.org to get around cross-origin AJAX issues

Open adrn opened this issue 6 years ago • 1 comments

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

adrn avatar Dec 09 '18 21:12 adrn

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.

eteq avatar Dec 10 '18 18:12 eteq