Skip to content

Instantly share code, notes, and snippets.

@daxiawj
Created March 25, 2014 05:24
Show Gist options
  • Save daxiawj/9755684 to your computer and use it in GitHub Desktop.
Save daxiawj/9755684 to your computer and use it in GitHub Desktop.
Duoshuo and Disqus Comment module for hexo blog system
<% if (!index && post.comments && config.disqus_shortname){ %>
<!--likaci tab.js init begin-->
<script type="text/javascript" src="/js/tab.js"></script>
<script type="text/javascript">
window.onload=function(){
var tabtype={trigger:'mouseover',tabCurrentClass:'newclass',auto:false,timer:4000,delay:300 };
tabInit(tabtype,['Disqus_bt','disqus_thread'],['duoshuo_bt','ds-thread'])
}
</script>
<!--likaic tab.js init end-->
<!--likaci css style begin-->
<style type="text/css">
#Disqus_bt,#duoshuo_bt { padding: 5px 10px 5px 7px; line-height: 17px; display: block; float: left; margin: 0 7px 0 0; background-color: #f5f5f5; border: 1px solid #dedede; border-top: 1px solid #eee; border-left: 1px solid #eee; }
#Disqus_bt{color: #336699}
#duoshuo_bt{color: #d12f19}
#duoshuo_bt.newclass{background-color:#DFF4FF}
#Disqus_bt.newclass{background-color:#E6EFC2}
</style>
<!--likaci css style end-->
<section id="comment">
<h1 class="title"><%= __('Comment') %></h1>
<!--likaci add button begin-->
<div id="duoshuo_bt">多说</div>
<div id="Disqus_bt" >Disqus</div>
<!--liakc add button end-->
<!--likaci add duoshuo begin-->
<div class="ds-thread"></div>
<script type="text/javascript">
var duoshuoQuery = {short_name:"daxiawj"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = 'http://static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<div id="disqus_thread">
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
<!--likaci add duoshuo end-->
</section>
<% } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment