Jekyll and Disqus: cannot get disqus to appear on site

99封情书 提交于 2019-12-12 19:13:19

问题


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.

You may view this work at my https://github.com/shaneoston72/shaneoston72.github.io

Thank you for any help you can offer.


回答1:


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

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

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

Replace this part for:

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

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?

Hope to have helped!



来源:https://stackoverflow.com/questions/35844744/jekyll-and-disqus-cannot-get-disqus-to-appear-on-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!