我正在尝试为此站点使用 discourseEmbedUrl 设置。我的评论组件在 github 上,但要点是:
window.DiscourseEmbed = {
discourseUrl: siteMetadata.comment.discourseConfig.url,
discourseEmbedUrl: thread,
discourseReferrerPolicy: 'no-referrer-when-downgrade',
}
其中 thread = window.location.href
我尝试了一些配置,现在我得到了完整的 URL 作为 Referer,但仍然“不匹配”。您可以在博客页面底部看到这一点。
编辑:我之前运行的是 2.8.0.beta10,我刚刚更新到 2.8.0.beta11,但情况仍然相同。我能想到的唯一其他干扰因素是,这个 Discourse 实例最初是在另一个 URL 上运行的,后来被迁移了(实际上是分叉了)。其他一切都运行正常,所以我没有理由认为迁移出了问题。