xiangming / landscape-plus

针对中国大陆地区对hexo官方主题landscape进行优化。
http://xiangming.github.io/landscape-plus/
MIT License
508 stars 107 forks source link

請問一下,點先可以在landscape-plus主題添加多說? #15

Closed zhiweihuang closed 10 years ago

zhiweihuang commented 10 years ago

如題,望不吝賜教。

xiangming commented 10 years ago

最快捷的方式是只修改landscape-plus\layout\_partial\after-footer.ejslandscape-plus\layout\_partial\article.ejs这两个文件,找到disqus的脚本替换为多说的代码。

<a href="<%- post.permalink %>#disqus_thread" class="article-comment-link">Comments</a>
<script>
  var disqus_shortname = '<%= config.disqus_shortname %>';
  <% if (page.permalink){ %>
  var disqus_url = '<%= page.permalink %>';
  <% } %>
  (function(){
    var dsq = document.createElement('script');
    dsq.type = 'text/javascript';
    dsq.async = true;
    dsq.src = '//go.disqus.com/<% if (page.comments){ %>embed.js<% } else { %>count.js<% } %>';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  })();
</script>

正确彻底的方式是全局搜索关键词disqus_shortname,将涉及到的文件,都进行对应的修改。

(如果有很多人需求,我会考虑集成进多说。)

weberhong commented 10 years ago

集成多说或者其它国产的评论组件吧.disqus真是卡...

xiangming commented 10 years ago

@zhiweihuang @getwe 我已经完成了多说和disqus的双集成,请帮忙测试功能是否正常。

zhiweihuang commented 10 years ago

【功能测试】正常,辛苦了~