Hexo默认使用的评论框是国外比较流行的Disqus,为方便使用我们可以把评论框替换成国内比较流行的多说,我使用的是官方landscape主题,具体步骤如下:

  1. 多说官网注册账号
  2. 选择我要安装创建站点
  3. _config.yml中添加多说配置(二级域名就是创建站点时填写的多说域名):
    duoshuo_shortname: 多说二级域名
    
  4. 修改themes\landscape\layout\_partial\article.ejs
    <% if (!index && post.comments && config.disqus_shortname){ %>
    <section id="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>
    </section>
    <% } %>
    
    替换成
    <% if (!index && post.comments && config.duoshuo_shortname){ %>
    <section id="comments">
     <!-- 多说评论框 start -->
     <div class="ds-thread" data-thread-key="<%= post.layout %>-<%= post.slug %>" data-title="<%= post.title %>" data-url="<%= page.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 = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
         ds.charset = 'UTF-8';
         (document.getElementsByTagName('head')[0] 
          || document.getElementsByTagName('body')[0]).appendChild(ds);
       })();
       </script>
     <!-- 多说公共JS代码 end -->
    </section>
    <% } %>
    
<% if (item.comment && config.disqus_shortname){ %>  
  <div class="alignright">  
    <a href="<%- item.permalink %>#disqus_thread" class="comment-link">Comments</a>  
  </div>  
<% } %>

替换成

<% if (item.comment && config.duoshuo_shortname){ %>  
  <div class="alignright">  
    <a href="<%- item.permalink %>#disqus_thread" class="comment-link">Comments</a>  
  </div>  
<% } %>