Jekyll和Disqus:无法让disqus出现在网站上 [英] Jekyll and Disqus: cannot get disqus to appear on site

查看:78
本文介绍了Jekyll和Disqus:无法让disqus出现在网站上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using Github Pages' Jekyll integration. I added the Disqus configuration today but Disqus does not appear on my posts. I have added the Disqus script to a file _includes/disqus.html and added {% include disqus.html %} to _layouts/default.html.

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

感谢您提供的任何帮助.

Thank you for any help you can offer.

推荐答案

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

Ok, we'll need to do a few things here:

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

At the end of your file _layouts/default.html what I see is:

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

将此部分替换为:

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

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

Then, on your file _includes/disqus.html, delete the first and the last line:

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

这应该可以完成工作.让我知道怎么回事,好吗?

This should do the job. Let me know how it goes, ok?

希望能有所帮助!

这篇关于Jekyll和Disqus:无法让disqus出现在网站上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆