抱歉,您的浏览器无法访问本站

本页面需要浏览器支持(启用)JavaScript


了解详情 >

hexo-generator-seo-friendly-sitemap(地图)

  • 说明

    生成 Sitemap 站点地图

  • 安装

    $ npm install hexo-generator-seo-friendly-sitemap --save
  • 配置

    _config.yml 中添加

    sitemap:
        path: sitemap.xml
        tag: false
        category: false

    如果需要在站点地图中排除页面和文章,可以在 front-matter 中添加:sitemap: false

hexo-generator-feed(RSS订阅)

  • 说明

    RSS 订阅插件

  • 安装

    $ npm install hexo-generator-feed --save
  • 配置

    _config.yml 中添加

    feed:
      type: atom
      path: atom.xml

hexo-autonofollow(添加nofollow)

  • 说明

    自动为站外链接添加 nofollow 属性

  • 安装
    $ npm install hexo-autonofollow --save

  • 配置
    _config.yml 中添加

    nofollow:
      enable: true  # 是否启用
      exclude:  # 排除域名
        - exclude1.com
        - exclude2.com

hexo-translate-title(标题翻译)

  • 说明

    使用 Google 翻译,百度翻译和有道翻译将 Hexo 中的汉字标题转成英文标题,配置完成后直接翻译,无需手工修改标题内容

  • 安装
    npm install hexo-translate-title --save

  • 配置
    _config.yml 中添加

    translate_title:####
      translate_way: google  # google,youdao,baidu_with_appid,baidu_no_appid
      youdao_api_key: '' # Your youdao_api_key
      youdao_keyfrom: xxxx-blog # Your youdao_keyfrom
      is_need_proxy: false     # true | false
      proxy_url: http://localhost:50018 # Your proxy_url
      baidu_appid: '' # Your baidu_appid
      baidu_appkey: '' # Your baidu_appkey

    _config.yml 中修改

    # 修改原链接格式:permalink: :year/:month/:day/:title/
    permalink: :year:month:day/:translate_title.html

hexo-auto-category(自动分类)

  • 说明

根据日志文件( Markdown )所在文件目录自动分类,即自动生成 markdown 的 front-matter 的 categories 变量。
比如日志路径:source/_post/web/framework/hexo.md,将自动生成以下 categories

categories:
  - web
  - framework
  • 安装
    $ npm install hexo-auto-category --save

  • 配置
    打开_config.yml 文件,添加以下配置

    # Generate categories from directory-tree
    # Dependencies: https://github.com/xu-song/hexo-auto-category
    # depth: the depth of directory-tree you want to generate, should > 0
    auto_category:
     enable: true
     depth:
  • 高级配置
    如果只想生成第一级目录分类,可以设置 depth 属性,比如:

    auto_category:
     enable: true
     depth:

hexo-git-backup(Hexo备份)

  • 说明

    将 hexo 博客源文件备份到 Github 。

  • 安装

    1. 进入博客目录,执行命令:hexo version,查看 hexo 版本
    2. 如果是 2.x.x,执行:
      $ npm install hexo-git-backup@0.0.91 --save
    3. 如果是 3.x.x,执行:
      $ npm install hexo-git-backup --save
  • 配置
    打开 _config.yml 文件,添加以下配置

    backup:
      type: git
      theme: indigo
      message: Back up my blog
      repository:
        github: git@github.com:xxx/xxx.git,master

hexo-abbrlink(URL优化)

  • 说明

    将 hexo 默认类似链接 https://blog.zerow.cn/2010/01/01/hello-world 自动修改为 https://blog.zerow.cn/develop/f55182c5.html 类似这种。

  • 安装

    $ npm install hexo-abbrlink --save

  • 配置

    1. _config.yml 中添加

      # abbrlink config
      abbrlink:
        alg: crc32  # 算法:crc16(default) and crc32
        rep: hex    # 进制:dec(default) and hex

      不同参数生成的链接样式:

      # crc16 & hex
      https://blog.zerow.cn/posts/66c8.html
      # crc16 & dec
      https://blog.zerow.cn/posts/65535.html
      # crc32 & hex
      https://blog.zerow.cn/posts/8ddf18fb.html
      # crc32 & dec
      https://blog.zerow.cn/posts/1690090958.html
    2. _config.yml 中修改

      permalink: :category/:abbrlink.html

      这里可以根据个人情况自定义,传入 :abbrlink 这个参数即可。

评论