hexo 多说设置

最近在网上看到了很多关于hexo的博客,做的都非常的漂亮
我也知道自己的技术肯定做不出来那么炫酷的页面,但是一些基本
东西还是要学会的不然怎么装逼呢!!哈哈哈!!!

多说设置

昨天百度了一晚终于把所说的设置弄好了,虽然没有那么的炫酷
但是基本的功能还是能实现的,不说废话了。

  • 首先把找到自己hexo下的_config.yml文件并打开
  • 接着在 ## Docs: https://hexo.io/docs/deployment.html
  • 增加一段代码即:(duoshuo_shortname: CXLYJ/CXLYJ.github.io.git)
  • 添加代码段 duoshuo_shortname:(这里面的代表你远程创库的访问地址,也就是所谓的二级域名)

接着在你的磁盘下的主题下找到:hexo\themes\yilia\layout_partial\article.ejs
在整个代码的后面添加上这段代码:

<% if (!index && post.comments && config.duoshuo_shortname){ %>
  <section id="comments">
   <!-- 多说评论框 start -->
<div id="ds-thread" class="ds-thread" data-thread-key="<%= post.path %>" data-title="<%= post.title %>" data-url="<%= post.permalink %>"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"datoublog"};
    (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>
  <% } %>
  • 最后 执行 hexo clean
  • hexo g
  • hexo d 就可以发不到互联网上去了

张开你的笔记就可以看到多说评论了

yilia主题所有文章显示

在这个主题下这个功能是缺失的所以提供一个方法来完善它

首先在hexo的目录下执行

npm i hexo-generator-json-content –save

这个语句就讲这个配置弄好了

最后

找到heox下的_config.yml文件并打开

在其最后插入

、、、

jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: true
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true

、、、

这样就将所有文章的显示弄好了接着发部到互联网即可。