美文网首页Hexo
【Hexo+Github系列】在Github上搭建完Hexo需要

【Hexo+Github系列】在Github上搭建完Hexo需要

作者: jtl0813 | 来源:发表于2017-02-10 16:01 被阅读0次

    在Github上部署完了Hexo 还有很多事情要做 修改title 修改一些基础信息 发表文章 等等 你看不顺眼的
    没有更改theme 我觉得原生的挺好用的 Landscape 另外我也想熟悉过后在体验别的 由简入繁

    1. 修改博客名称 作者等 在_config.yml中直接修改
    2. 安装RSS与SITEMAP 安装完Hexo之后发现受也有RSS(但是404)并且没有SITEMAP 安装之
      npm install hexo-generator-feed --save //rss
      npm install hexo-generator-sitemap --save //sitemap
      安装完之后修改配置 themes\landscape\menu_config.yml:里添加网站地图:/sitemap.xml
    3. 版权信息修改 页尾的有hexo连接 看着hexo连接 总感觉站点不是自己的 改之
      layout_partial\footer.ejs 倒数第四行 修改了
    4. 添加评论框 增加点实用功能 与网友互动 目前有两个评论系统靠谱 discus(访问很慢 pass掉) 多说 直接用多说
      • layout_partial\article.ejs中将中部 dis 评论按钮代码替换为:
      <% if (post.comments){ %>
          <a href="<%- post.permalink %>#ds-thread" class="ds-thread-count article-comment-link" data-thread-key="<%- post.path%>">评论</a>
      <% } %>  
      
      • layout_partial\article.ejs中底部 dis 评论框替换为:
      <% if (!index && post.comments){ %>
      <section id="comments">
          <div id="ds-thread" class="ds-thread" data-thread-key="<%= post.path%>" data-title="<%= post.title %>" data-url="<%= post.permalink %>"></div>
      </section>
      <% } %>
      
      • layout_partial\after-footer.ejs中 discus 评论框替换为从多说获得的js代码:
      <!-- 多说评论框 end -->
      <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
      <script type="text/javascript">
          var duoshuoQuery = {short_name:"username"};
          (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 -->
      
    5. 如何发表新文章
      hexo new "title"
      
      然后去source/_posts下面编辑文章
      最后发布到github上面
      hexo g
      hexo d
      
    6. 折叠文章 发表了好几篇文章 发现无法折叠 把屏幕都占满了 醉了
      添加<!--more-->标签   注意  此标签不能添加在文章开头处 无效(为什么?添加到开头了 折叠毛文章啊)
      

    好了 享受写博客的乐趣吧 还有很多等待发掘

    相关文章

      网友评论

        本文标题:【Hexo+Github系列】在Github上搭建完Hexo需要

        本文链接:https://www.haomeiwen.com/subject/vmngittx.html