2017-02-22 13:42:22 +08:00

43 lines
1.9 KiB
Plaintext

<% if (config.duoshuo_shortname && page.comments){ %>
<!-- 多说评论框 start -->
<div id="ds-thread" class="ds-thread" data-thread-key="<%- config.root %><%- post.path %>" data-title="<%- post.title %>" data-url="<%- post.permalink %>"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name: "<%- config.duoshuo_shortname %>"};
(function () {
var ds = document.createElement('script');
ds.type = 'text/javascript';
ds.async = true;
ds.src = '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- 多说公共JS代码 end -->
<% } else if (config.disqus_shortname && page.comments) { %>
<section class="post-comments">
<div id="disqus_thread">
<noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
<script type="text/javascript">
var disqus_shortname = '<%= config.disqus_shortname %>';
(function(){
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
(function(){
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
</section>
<% } %>