-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The front-matter's permalink can not override config.permalink #3464
Comments
@yoshinorin curious , so if you exclude
|
Thanks @gautamz07 :) I think maybe ...
But it is just my personal opinion... |
Oh got it :) i ran into this same issue a while back .. i did't want that YY/MM/DD |
It seems that only post is affected. The dedicated pages won't be affected. |
Since only the post is affected, I wonder if the issue is about |
Let me make the issue a little more clear: When config.permalink is set and no permalink in the front-matter # _config.yml
new_post_name: :title.md # File name of new posts
permalink: post/:name/
permalink_defaults: :title/
---
title: "This is a test"
date: 2021-01-31 20:44:31
--- Then I get: And if I change it to this: # _config.yml
new_post_name: :title.md # File name of new posts
permalink: post/:title/ # Use :title instead of :name
permalink_defaults: :title/ ---
title: "This is a test"
date: 2021-01-31 20:44:31
--- I will get Try to use front-matter to override config.permalink Here you go! # _config.yml
new_post_name: :title.md # File name of new posts
permalink: post/:title/ # Use :title instead of :name
permalink_defaults: :title/ ---
title: "This is a test"
date: 2021-01-31 20:44:31
permalink: hexo-hexo-hexo/i-love-hexo
--- Guess what! I get So I changed my config again, this time I will use # _config.yml
new_post_name: :title.md # File name of new posts
permalink: post/:title/ # Use :title instead of :name
permalink_defaults: :title/ ---
title: "This is a test"
date: 2021-01-31 20:44:31
permalink: hexo-hexo-hexo/i-love-hexo
--- Then what? I get So it appears that not only |
So here is what I found. hexo/lib/plugins/processor/post.js Lines 123 to 126 in edef5c2
As you can see, But So what Lines 48 to 51 in edef5c2
Ha! The Yes, Even the Lines 53 to 55 in edef5c2
|
:title/
the Front-matter's permalink seems not override correctly
from #3442
Environment Info
Your site
_config.yml
(Optional):and frontmatter is
Expected behavior
URL is
http://localhost:3000/first-blog
Actual behaviot
URL is
http://localhost:3000/2019/01/first-blog
The text was updated successfully, but these errors were encountered: