hexo icon indicating copy to clipboard operation
hexo copied to clipboard

Permalink issues

Open leesei opened this issue 10 years ago • 5 comments

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

leesei avatar Mar 07 '16 05:03 leesei

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.

leesei avatar Mar 15 '16 15:03 leesei

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.

Ether0xF avatar Jul 12 '16 09:07 Ether0xF

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.

curbengh avatar Aug 30 '19 09:08 curbengh

Any updates? Seems that the issue is still there in hexo 3.8

icpz avatar Mar 02 '20 17:03 icpz

There is a discussion about it: #3464 I'm closing this issue. Please join the discussion there :)

Update: Fixed in #4359

stevenjoezhang avatar Jun 14 '20 02:06 stevenjoezhang