品牌网站建设解决方案,网站排名推广工具,宁波营销网站建设,百度2022新版下载sphinx 升级到6.0 后#xff0c;以前对于jquery的默认引用方式发生了改变以前在编译后的html中jquery是如下引用的#xff1a;script src_static/jquery.js/script而升级到6.0后#xff0c;对于jquery 是一个googleapi的远程jquery调用#xf…sphinx 升级到6.0 后以前对于jquery的默认引用方式发生了改变以前在编译后的html中jquery是如下引用的 script src_static/jquery.js/script而升级到6.0后对于jquery 是一个googleapi的远程jquery调用这会导致sphinx 半天才能打开。解决这个问题的方案是升级所有的包包括sphinxcontrib-jquery,然后进行争取的配置。在sphinx 的changelog中对于这点有明确的说明#7405: Removed the jQuery and underscore.js JavaScript frameworks.These frameworks are no longer be automatically injected into themes from Sphinx 6.0. If you develop a theme or extension that uses thejQuery, $, or $u global objects, you need to update yourJavaScript to modern standards, or use the mitigation below.The first option is to use the sphinxcontrib.jquery extension, which has been developed by the Sphinx team and contributors. To use this, addsphinxcontrib.jquery to the extensions list in conf.py, or callapp.setup_extension(sphinxcontrib.jquery) if you develop a Sphinx themeor extension.The second option is to manually ensure that the frameworks are present.To re-add jQuery and underscore.js, you will need to copy jquery.js andunderscore.js from the Sphinx repository to your static directory,and add the following to your layout.html:{%- block scripts %}script src{{ pathto(_static/jquery.js, resourceTrue) }}/scriptscript src{{ pathto(_static/underscore.js, resourceTrue) }}/script{{ super() }}
{%- endblock %}原文地址https://www.sphinx-doc.org/en/master/changes.html