ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Hexo 必装插件

2022-07-05 03:31:23  阅读:191  来源: 互联网

标签:插件 false Hexo hexo 必装 auto default abbrlink


可以优化博客路径,默认路径 https://xcmaster.com/2022/07/07/hexo必装插件,还会带上标题,这款插件可以将路径优化为 https://xcmaster.com/posts/51727 等等,还支持 16进制。

安装

npm install hexo-abbrlink --save

_config,yml 加入配置

abbrlink:
  alg: crc16      #support crc16(default) and crc32
  rep: dec        #support dec(default) and hex
  drafts: false   #(true)Process draft,(false)Do not process draft. false(default) 
  # Generate categories from directory-tree
  # depth: the max_depth of directory-tree you want to generate, should > 0
  auto_category:
     enable: true  #true(default)
     depth:        #3(default)
     over_write: false 
  auto_title: false #enable auto title, it can auto fill the title by path
  auto_date: false #enable auto date, it can auto fill the date by time today
  force: false #enable force mode,in this mode, the plugin will ignore the cache, and calc the abbrlink for every post even it already had abbrlink. This only updates abbrlink rather than other front variables.

详情请看 github: https://github.com/rozbo/hexo-abbrlink

2.hexo-asset-image

自动为文章中的图片提供绝对路径,需要设置 _config.yml

post_asset_folder: true

比如新建一片博客名为 hexo-plugin,那么在创建文章 md 文件的同时会创建一个 hexo-plugin 的目录,文章对应的图片放入这个目录就行。

Typora 可以将图像设为 ./${filename} 便可自动适配

3.sitemap

SEO 可以增加搜索引擎对我们博客的收录和结果排名,所以我们还是有必要做一下 SEO,增加文章的曝光率。

hexo 具有 sitemap 插件,可以生成站点地图,然后提交给搜索引擎,增加文章被索引的几率。

安装:

npm i hexo-generator-baidu-sitemap --save # 百度用

npm i hexo-generator-sitemap --save # Google 用

安装好这两个插件以后,生成博客时会在 public 目录下生成 sitemap.xml 和 baidusitemap.xml,我们向搜索引擎提交这两个文件就可以了。

标签:插件,false,Hexo,hexo,必装,auto,default,abbrlink
来源: https://www.cnblogs.com/stulzq/p/16445025.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有