美文网首页
多说在hexo中的配置

多说在hexo中的配置

作者: leenty | 来源:发表于2016-10-11 00:39 被阅读814次

在_config.yml中添加多说的配置:

(⚠️注意:_config.yml在根目录和主题根目录都会存在,主题目录下的文件信息将会覆盖根目录的文件信息)

duoshuo: 你站点的short_name
duoshuo_shortname: 你站点的short_name

修改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>
<% } %>

同时使用多个deployer

单个deployer的时候的 _config.yml

deploy:
  type: git
  repo: git@github.com:leenty/leenty.github.io.git
  branch: master

而换成多个deployer的时候需要在前面加-

deploy:
- type: git
  repo: git@github.com:demo/demo.github.io.git
  branch: master
- type: git
  repo: git@git.coding.net:demo/demo.git
  branch: master

相关文章

  • 多说在hexo中的配置

    在_config.yml中添加多说的配置: (⚠️注意:_config.yml在根目录和主题根目录都会存在,主题目...

  • hexo 安装与配置

    title: hexo 安装与配置 categories: 工具 tags: [Hexo,GitHub,多说评论]...

  • 为hexo添加RSS订阅

    安装hexo-generator-feed 在hexo根目录下执行下列命令 然后在_config.yml 中配置如...

  • nginx快速搭建静态博客

    1.安装配置Hexo 在mac上安装Node/Npm,使用homebrew安装 安装Hexo 2.配置Hexo文件...

  • Blogging On Github

    使用Hexo+Github配置博客 初步使用Hexo+Github配置博客 进阶最详细的Hexo Next主题配置...

  • Mac本地配置hexo + Atom Markdown,连接Gi

    本篇主要内容如下: hexo Atom markdown环境配置和使用 本地配置hexo环境 选择并配置hexo ...

  • Hexo使用、Markdown语法笔记

    Hexo 原文在博客MaxMa 命令 配置 npm install hexo -g //安装npm update ...

  • Hexo+github搭建自己的博客

    Hexo+github搭建自己的博客 在好友冬瓜的推荐下,我开启了hexo的新天地。话不多说,直接上hexo+gi...

  • Hexo:light 主题中添加多说评论

    随着越来越多第三方 Hexo 主题的出现,很多主题都已经支持多说评论,而且简单地配置就能接通多说评论后台管理并匹配...

  • Hexo博客搭建记录

    Hexo是一款优秀的静态博客,本文主要记录了在搭建Hexo博客时的一些安装配置。通过Hexo配置了自己的个人博客,...

网友评论

      本文标题:多说在hexo中的配置

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