前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Hexo 必装插件

Hexo 必装插件

作者头像
晓晨
发布2022-09-02 17:09:17
5570
发布2022-09-02 17:09:17
举报
文章被收录于专栏:晓晨的专栏晓晨的专栏

1.hexo-abbrlink

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

安装

代码语言:javascript
复制
npm install hexo-abbrlink --save

_config,yml 加入配置

代码语言:javascript
复制
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

代码语言:javascript
复制
post_asset_folder: true

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

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

3.sitemap

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

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

安装:

代码语言:javascript
复制
npm i hexo-generator-baidu-sitemap --save # 百度用

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

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

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2022-07-05,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1.hexo-abbrlink
  • 2.hexo-asset-image
  • 3.sitemap
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档