Loading

Hexo 必装插件

可以优化博客路径,默认路径 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,我们向搜索引擎提交这两个文件就可以了。

posted @ 2022-07-05 02:57  晓晨Master  阅读(1801)  评论(0编辑  收藏  举报