修改hexo博文url

概览:

改变原来hexo对博文url的组织方式,方便SEO,并且中文链接在百度权重很低。
然后在网上找到了一个大神写的插件hexo-abbrlink,酷,很酷,特别酷。
插件作者博客 青枫浦

该插件的github地址 rozbo/hexo-abbrlink

使用

1
cnpm install hexo-abbrlink --save

修改主题_config.yml文件中的永久链接:

1
2
3
4
5
6
permalink: website/:abbrlink/ #:year-:month/:title/
permalink_defaults:

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

有两种设置:

1
2
alg -- Algorithm (currently support crc16 and crc32, which crc16 is default)
rep -- Represent (the generated link could be presented in hex or dec value)

样品

生成的链接如下所示:

1
2
3
4
5
6
7
8
9
10
11
crc16 & hex
https://post.zz173.com/posts/66c8.html

crc16 & dec
https://post.zz173.com/posts/65535.html

crc32 & hex
https://post.zz173.com/posts/8ddf18fb.html

crc32 & dec
https://post.zz173.com/posts/1690090958.html
------ 文章已经结束,谢谢你的阅读 ------
------ article has ended,thank you for reading ------
Thanks support Me

---------------- The End ----------------