Hexo-nexT博客搭建-Hexo优化-修改文章永久链接为随机编号

推荐先阅读【2022教程全】Hexo博客 + nexT主题

配置完成后的链接示例:https://zxblog.eu.org/posts/5a75/

cd到博客目录下,执行:

npm install hexo-abbrlink --save

如图:(然后回车,我安装过了,就不演示了)

image-20220810192531525

博客下配置文件 ../blog/_config.yml 修改:

# 网站域名
# Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://zxblog.eu.org/
# permalink: :year/:month/:day/:title/
# permalink: :title/
# 文章链接地址格式 。即文章存放的目录。
permalink: posts/:abbrlink/
# 文章链接数字插件
abbrlink:
alg: crc16
rep: hex
permalink_defaults:
pretty_urls:
trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
trailing_html: true # Set to false to remove trailing '.html' from permalinks