Hexo文章链接问题

wshunli
2017-11-06 / 1 评论 / 224 阅读 / 正在检测是否收录...

Hexo 文章链接问题

今天 搜索 一下网站,发现有个很大的问题。

有很多链接 404,比如这个链接:

http://www.wshunli.com/2017/10/29/《JavaScript高级程序设计》读书笔记(一)/

搜索引擎跳转之后是:

http://www.wshunli.com/2017/10/29/《javascript高级程序设计》读书笔记(一)/

单单因为 JavaScript 大小写的问题,就找不到页面。

所以在 Hexo 官网找了一下固定链接的插件。

最终选择是: hexo-abbrlink ; Github :https://github.com/rozbo/hexo-abbrlink

安装插件:

npm install hexo-abbrlink --save

在站点配置文件中修改 permalink

permalink: posts/:abbrlink.html

站点配置文件中配置插件:

# abbrlink config
abbrlink:
  alg: crc32  #support crc16(default) and crc32
  rep: hex    #support dec(default) and hex

链接效果:

crc16 & hex
https://www.wshunli.com/posts/66c8.html
crc16 & dec
https://www.wshunli.com/posts/65535.html
crc32 & hex
https://www.wshunli.com/posts/8ddf18fb.html
crc32 & dec
https://www.wshunli.com/posts/1690090958.html

更多内容参考:https://post.zz173.com/detail/hexo-abbrlink.html

0

评论 (1)

取消