在 jekyll 博客上安装 disqus 评论

发布于 2025-01-11 00:48:58 字数 635 浏览 3 评论 0原文

我已按照 Disqus 页面上关于如何安装 disqus 评论的说明进行操作,但是,当我部署博客网站时,它不会加载。 我将disqus通用代码放入includes文件夹中,然后将其添加到post.html文件中。 我在通用 disqus 代码中更改了以下代码:

var disqus_config = function () {
    this.page.url = {{ site.url }}{{ page.url }}; // Replace PAGE_URL with your page's canonical URL variable
    this.page.identifier = {{ page.url }}; // Replace PAGE_IDENTIFIER with your page's unique identifier variable 
};

post.html 文件中,我有:

{% include comments.html %}

还有其他我丢失的东西吗?

I have followed the instruction on the Disqus page on how to install disqus comment but, it does not load up when I deploy my blog site.
I put the disqus universal code into the includes folder and then added it in the post.html file.
I changed the following code in the universal disqus code:

var disqus_config = function () {
    this.page.url = {{ site.url }}{{ page.url }}; // Replace PAGE_URL with your page's canonical URL variable
    this.page.identifier = {{ page.url }}; // Replace PAGE_IDENTIFIER with your page's unique identifier variable 
};

In the post.html file I have:

{% include comments.html %}

Is there something else I am missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葬﹪忆之殇 2025-01-18 00:48:58
var disqus_config = function () {
    this.page.url = "{{ site.url }}{{ page.url }}"; // Replace PAGE_URL with your page's canonical URL variable
    this.page.identifier = "{{ page.url }}"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable 
};

我必须将 this.page.url 放入字符串引号中,正如您从上面的代码中看到的那样。 this.page.identifier 也是如此

var disqus_config = function () {
    this.page.url = "{{ site.url }}{{ page.url }}"; // Replace PAGE_URL with your page's canonical URL variable
    this.page.identifier = "{{ page.url }}"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable 
};

I had to put the this.page.url into strings quotes as you can see from the code above. The same goes for the this.page.identifier

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文