Permalink issues
This is an umbrella issue pertaining permalink in Hexo.
We should document how permalink (or link in general) is resolved from config.permalink, post.permalink file name, slug, title.
These cause quite a bit of confusion for the users and escaping of special characters.
#1812
#1608
#1110
#881 / #1258
https://github.com/hexojs/hexo-generator-sitemap/issues/1 Use URL safe characters (slug should be serving this purpose)
https://github.com/hexojs/hexo-generator-sitemap/issues/13 Use permalink as canonical URL (in HTML header and sitemap)
#1822 . in post file name
From #1822, I recommend issuing a warning for posts and assets with non-URL safe characters (slugtize(filename) !== filename).
We can inform users to use post.permalink instead.
I see this is an umbrella issue, so I decide to append the issue here as discussion instead of posting a new (and duplicated) one. The permalink overriding bug, refers to #1110 and #1158, was still happening in my hexo project as hexo version 3.2.2. In config.yml, my permalink is:
permalink: :category/:year-:month-:day/
In front-matter, I set the permalink like:
permalink : /title-I-want/
but it did not override the permalink in config.yml. I'm wondering that if I set the value in an appropriate format. What exactly the format is?
Solution provided by @liudongkai was not a handy one that I expected, since I have 180+ posts that migrated from wordpress. Re-assign a permalink to each post manually sounds incredible... Any other suggestions would be very appreciated.
In front-matter, I set the permalink like:
permalink : /title-I-want/but it did not override the permalink in config.yml.
can confirm (I'm assuming you're talking about post). It only override the :title/ part of config.yml.
Any updates? Seems that the issue is still there in hexo 3.8
There is a discussion about it: #3464 I'm closing this issue. Please join the discussion there :)
Update: Fixed in #4359