在 ReadTheDocs 托管的站点中嵌入 Discourse 评论

大家好,

我一直在尝试将我们论坛的 Discourse 评论添加到我们的文档网站。
我们在 ReadTheDocs 上托管文档。

我使用了来自 Discourse 自定义/嵌入的 JavaScript,但它只会显示“讨论加载中”。

链接:
论坛
Discourse 嵌入 URL(ReadTheDocs 网站)

我检查了页面,在控制台中发现了这条错误消息

无效的 X-Frame-Options: “ALLOWALL” 标头,来自“[https://forum.zenko.io/embed/comments?embed_url=https%3A%2F%…tsInReadTheDocs%2Freference%2Fobject_operations%2Findex.html](https://forum.zenko.io/embed/comments?embed_url=https%3A%2F%2Fzenko.readthedocs.io%2Fen%2Fdocumentation%2FZENKOIO-111-ForumCommentsInReadTheDocs%2Freference%2Fobject_operations%2Findex.html)”,加载到“[https://zenko.readthedocs.io/en/documentation-zenkoio-111-fo…commentsinreadthedocs/reference/object_operations/index.html](https://zenko.readthedocs.io/en/documentation-zenkoio-111-forumcommentsinreadthedocs/reference/object_operations/index.html)”。

如果这有帮助:

请求 URL: https://forum.zenko.io/embed/comments?embed_url=https%3A%2F%2Fzenko.readthedocs.io%2Fen%2Fdocumentation%2FZENKOIO-111-ForumCommentsInReadTheDocs%2Findex.html
请求方法: GET
远程地址: 72.52.80.11:443
状态码:
400
版本: HTTP/2.0

有人遇到过类似问题或能提供帮助吗?

非常感谢!:blush:

你好,Dasha,

我刚查看了你在评论中提到的网站,看来你已经解决了问题。能否请你简单描述一下你是如何解决的?我似乎遇到了同样的问题,你的方法可能也对其他人有帮助。

谢谢!

你好 @Tokapeb
很难确切地说是什么解决了我的问题,但据我回忆,我做了两件事来修复它:

  • 在论坛站点设置中将我的网站 URL 添加到 cors origins
  • 将脚本中的 discourse 嵌入 URI 更改为规范形式(之前不是)

希望这能有所帮助 :slight_smile: