Jekyll 和 Disqus : cannot get disqus to appear on site

标签 jekyll github-pages disqus

我正在使用 Github Pages 的 Jekyll 集成。我今天添加了 Disqus 配置,但 Disqus 没有出现在我的帖子中。我已将 Disqus 脚本添加到文件 _includes/disqus.html 中,并将 {% include disqus.html %} 添加到 _layouts/default.html 中。

您可以在我的https://github.com/shaneoston72/shaneoston72.github.io查看此作品

感谢您提供的任何帮助。

最佳答案

好的,我们需要在这里做一些事情:

在文件_layouts/default.html的末尾我看到的是:

 </div>
    {% include disqus.html %}
    {% include footer.html %}   
  </body>

将此部分替换为:

 </div>
    {% include footer.html %}
    {% if page.comments %}
    {% include disqus.html %}
    {% endif %}
  </body>

然后,在您的文件 _includes/disqus.html 上,删除第一行和最后一行:

{% if post.comments %}
.....
{% endif %}

这应该可以完成工作。让我知道进展如何,好吗?

希望对您有所帮助!

关于Jekyll 和 Disqus : cannot get disqus to appear on site,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35844744/

相关文章:

jekyll - jekyll 中的区域设置特定日期

jekyll - 在 Jekyll 中使用 pygments 时如何支持行号

github - 如何在不同分支下的一个存储库中创建多个 GitHub 页面?

php - 有没有办法通过他们的 API 搜索特定搜索词的所有 Disqus 评论

javascript - kramdown rouge 不应该用 jekyll 生成语法高亮类吗?

javascript - 使用 load_paths 时未找到 Jekyll node_modules

travis-ci - 使用 Travis CI 将 Lektor 站点部署到 Github Pages 时出错

ruby - 如何 bundle html 管道安装后消息中提到的 Filter gem 依赖项?

javascript - 制作 Disqus 2012 RTL

javascript - 在 disqus 评论脚本中更改语言