hexo-theme-amane/layout/comment/disqus.ejs

22 lines
893 B
Plaintext
Raw Normal View History

2018-10-16 05:28:42 +00:00
<% if (has_config('comment.shortname')) { %>
<script>
var disqus_config = function () {
2018-10-16 05:28:42 +00:00
this.page.url = '<%= page.permalink %>';
this.page.identifier = '<%= page.disqusId || page.path %>';
};
2018-10-16 05:28:42 +00:00
(function() {
var d = document, s = d.createElement('script');
2018-10-16 05:28:42 +00:00
s.src = '//' + '<%= get_config('comment.shortname') %>' + '.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
2018-10-16 05:28:42 +00:00
<% } %>
<div id="disqus_thread">
<% if (!has_config('comment.shortname')) { %>
<div class="notification is-danger">
You forgot to set the <code>shortname</code> for Disqus. Please set it in <code>_config.yml</code>.
</div>
2018-10-16 05:28:42 +00:00
<% } %>
<noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>