readthedocs / sphinx_rtd_theme

Sphinx theme from Read the Docs
https://sphinx-rtd-theme.readthedocs.io/
MIT License
4.8k stars 1.74k forks source link

Set data-content_root for Sphinx ≥ 7.2 #1507

Closed mitya57 closed 1 year ago

mitya57 commented 1 year ago

This attribute is now required by searchtools.js: https://github.com/sphinx-doc/sphinx/blob/v7.2.2/sphinx/themes/basic/static/searchtools.js#L65

And this is what Sphinx' own layout.html does: https://github.com/sphinx-doc/sphinx/blob/v7.2.2/sphinx/themes/basic/layout.html#L105

When the attribute is not set, loading search results via AJAX will be broken because the JS code will attempt to load paths like /undefinedfoo.html.