首页 文章

Jekyll和Disqus:无法让disqus出现在网站上

提问于
浏览
1

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

你可以在https://github.com/shaneoston72/shaneoston72.github.io查看这项工作

感谢您提供的任何帮助 .

1 回答

  • 1

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

    在您的文件末尾 _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 %}
    

    这应该做的工作 . 让我知道它是怎么回事,好吗?

    希望有所帮助!

相关问题