设置时
我的个人博客
使用jekyll时,我发现我无法获得显示的评论部分。它一直在告诉我:
我们无法加载Disqus。如果您是版主,请参阅我们的故障排除指南。
相关代码:(完整代码请访问我的repo:
https://github.com/sunqingyao/sunqingyao.github.io
)
_
config.yml
disqus:
shortname: sled-dog_
布局/post.html
{% if site.disqus.shortname %}
{% include disqus_comments.html %}
{% endif %}disqus
_
comments.html
{% if page.comments != false and jekyll.environment == "production" %}
var disqus_config = function () {
this.page.url = '{{ page.url | absolute_url }}';
this.page.identifier = '{{ page.url | absolute_url }}';
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
Please enable JavaScript to view the comments powered by Disqus.
{% endif %}我已经通读了
故障排除指南
几次,并检查了所有可能的情况,但评论仍然没有出现。
有几点需要注意:
我正在使用
最小值
,jekyll的默认主题,并遵循其
文档
..。
我已经注册了Disqus帐户并验证了电子邮件地址。
我的网站简称是
..。
已添加到“受信任域”中。
发布于 2017-01-12 21:18:04
中有一个错误。
变量。
它应该包含页面的唯一标识符,但它当前正在设置页面的url:
您应该将其更改为:
this.page.identifier = {{ site.disqus.shortname }}';再见
更新
环绕
带有注释标签:
..。
发布于 2017-10-29 04:18:28
我很惊讶,最好的答案是禁用discus.config。
如果您在您的网站上启用默认jekyll主题的disqus有问题,请检查参数。
_
config.yml
应包括:
JEKYLL
_
环境
应设置为"production“
这就是你所需要的。祝你好运。
发布于 2020-01-04 22:48:12
看了@nazlok的原始帖子,我在谷歌上搜索了一下,也遇到了类似的问题,我发现disqus很短
_
名称与disqus帐户名称不同。事实上,它是特定于站点的。
从我在你身上看到的
_
config.yml
,您的
可能是您的“disqus帐户名”。
确认您输入了正确的短码
_
站点的名称。请参见
什么是短名称
关于如何访问短信息
_
名字。
https://stackoverflow.com/questions/41613661
复制相似问题