python - 当页面上不存在该短语时,“正在搜索...”将永远占用 readthedocs
问题描述
当我搜索 readthedocs 页面上不存在的短语时,我收到以下消息:
“正在搜索……”,这将永远持续下去。相反,当我搜索一些已知的短语时,我会在一秒钟内得到结果。
我查看了页面的控制台:
来自“https://xxxxxx.readthedocs.io/en/latest/_static/css/yy.css”的资源因 MIME 类型(“text/html”)不匹配(X-Content-Type-Options: nosniff)而被阻止)。阅读文档搜索失败。回退到 Sphinx 搜索。
我努力了:
[conf.py] 我有一行:
html_css_files = [ "css/yy.css", ]
所以我补充说:
app.add_css_file(html_css_files)
在def setup(app):
但这导致 readthedocs 中的构建错误
我在conf.py中添加了:
notfound_urls_prefix = "/projects/xxxxxx/en/latest/"
但这也没有帮助。
你遇到过类似的事情吗?如果是这样,您是如何解决问题的?
解决方案
最后,根本原因在其他地方。当我查看 rtd 上的原始输出时,我发现 sphinx_rtd_theme 安装了 0.4.3,这不是最新的。最新的是 0.5.2。所以我将最新版本固定在我的 docs/requiremets.txt 中。这解决了搜索问题。
推荐阅读
- c# - 如何修复在使用同一服务器的两个单独系统中使用时出现问题的 winform 应用程序
- docker - Docker Swarm 中的 Consul
- java - javax validation-api 返回 Map.Entry.value 而不是 Map.Entry.key
- ruby-on-rails - Rails 根据通过三个表和关联表的客户邮政编码向经理发送电子邮件
- spring-cloud-stream - Spring Cloud Stream:spring.cloud.stream.default.consumer.concurrency 属性的确切含义
- javascript - 如何更改此代码以使用给定元素
- rxjs - 如何使用 rxjs6 轮询作业结果并在状态完成时终止?
- regex - Spring Boot 应用程序中多个 Angular 客户端的 RequestMapping 问题
- laravel - Laravel 响应方法不允许
- javascript - 在没有 JQuery 的客户端上显示 JSON 服务器响应