博客成长记

加入评论功能

2015-04-15 12:59:49

  1. 使用微博或者其他帐号登录多说,建立自己的一个帐号,同时拿到通用代码.

  2. 取消HEXO博客根目录中的 _config.ymldisqus_shortname: ,暂时不用这个功能,直接永久开启多说评论。

  3. 修改主题目录下面的(我的是 /themes/jacman/_config.ym ) _config.yml 中的

1
2
#### Comment
duoshuo_shortname: guiqingblog ## e.g. wuchong your duoshuo short name.

如果没有请添加.

  1. 修改 themes\XXX\layout_partial\article.ejs
    在最后加上下面的代码:
1
2
3
<% if(!index){ %>
<%- partial('comment') %>
<% } %>
  1. 修改 themes/jacman/layout/_partial/post/comment.ejs 为你通用代码的 js 部分,如果没有这个文件请新建.

最终效果:

参考网址:

http://gpio.me/hexo-duoshuo.html
http://duoshuo.com