Jekyll博客中未加载Disqus

问题描述 投票:1回答:1

我无法使Disqus在我的Jekyll博客上工作。我遵循了Disqus网站上的说明。我在帖子布局中添加了评论

---
layout: default
comments: true
---
<h1>{{ page.title }}</h1>
<p>{{ page.date | date_to_string }} - {{ page.author }}</p>

{{ content }}

{% include disqus.html %}

使用disqus.html,使用由Disqus网站生成的代码

{% if page.comments %}
<div id="disqus_thread"></div>
<script>

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/

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

(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://rohit-gupta-blog.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

{% endif %}

以下是我的网站post上博客文章的示例。如果需要,Here是我的git hub存储库。

javascript html jekyll disqus
1个回答
0
投票

[page.urlpage.url看起来应该是字符串,但没有引号。这是在页面上呈现的配置:

© www.soinside.com 2019 - 2024. All rights reserved.