Customized Website Article Link
Abstract
In the default setting of Hexo and Next , my article ‘s usl is long and ugly , so I want to customize my article’s lick ,which is concise and static . Fortunately , I finally find a hexo plugin called hexo-abbrlink
, which is really amazing ! Here is the link : rozbo/hexo-abbrlink: create one and only link for every post for hexo (github.com)
Install and Configure it
- Add plugin to Hexo :
1 | npm install hexo-abbrlink --save |
- Modify
config.yml
Change the origin code
1 | permalink: :year/:month/:day/:title/ |
into(You can choose one of two ways below :)
1 | permalink: posts/:abbrlink/ |
or
1 | permalink: posts/:addrlink.html |
Be careful :
There is a /
in the end of permalink: posts/:abbrlink/
, and not in permalink: posts/:addrlink.html
! This /
is really important .
- Add the codes below in the end of file
config.yml
1 | # abbrlink config |
You can modifly the parameters alg
and rep
according to your preference , and their meaning is as follow :
1 | alg -- Algorithm (currently support crc16 and crc32, which crc16 is default) |
- Final Nagging
- If your article ‘s URL is still the style
:year/:month/:day/:title/
, you may forget to changepermalink: :year/:month/:day/:title/
intopermalink: posts/:abbrlink/
orpermalink: posts/:addrlink.html
. Another reason may be"GitHub just can't response at once"
, so just wait for minutes patiently ~ - Just don’t forget the
/
in the end ofpermalink: posts/:abbrlink/
Actually , I had fallen into two traps mentioned above .
- That’s all .