Hexo自动文章固定链接插件 abbrlink
本文于 1135 天之前发表,文中内容可能已经过时。
Hexo abbrlink插件基于文章的标题自动为文章生成固定链接。
安装
安装npm包:
npm install hexo-abbrlink --save
修改
_config.yml
文件中的配置项:permalink: posts/:abbrlink/
设置
Abbrlink插件拥有两项设置选项:
alg
: 算法(目前支持crc16
和crc32
算法,默认值是crc16
)rep
: 形式(生成的链接可以是十六进制格式也可以是十进制格式,默认值是十进制格式)
示例
# abbrlink config
abbrlink:
alg: crc32 #support crc16(default) and crc32
rep: hex #support dec(default) and hex
示例
生成的链接地址将会和下面的实例看起来相似:
crc16 & hex
https://hexo.comptechs.cn/posts/66c8.html
crc16 & dec
https://hexo.comptechs.cn/posts/65535.html
crc32 & hex
https://hexo.comptechs.cn/posts/8ddf18fb.html
crc32 & dec
https://hexo.comptechs.cn/posts/1690090958.html
局限
crc16
算法生成的最大数是65536
评论系统未开启,无法评论!