【发布时间】:2017-01-18 02:10:54
【问题描述】:
我创建了一个博客,我想将 Disqus 集成到该站点中,以便人们可以发布 cmets。我按照 Disqus 网站上列出的步骤,一切正常,直到我开始设置配置变量的部分。 Disqus 停止加载并显示。我不确定我在这里做错了什么。
下面是我的代码:
<div id="disqus_thread"></div>
<script>
var disqus_config = function ()
this.page.url = '<%= url_for([@post, {:only_path => false}]) %>'; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = '<%= @post.id %>'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
this.page.title = '<%= @post.title %>';
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//york-wang.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>
【问题讨论】:
标签: ruby-on-rails disqus