Skip to content
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

new_post_name prefix works in sub post folder? #5275

Open
2 of 5 tasks
lephones opened this issue Aug 21, 2023 · 1 comment
Open
2 of 5 tasks

new_post_name prefix works in sub post folder? #5275

lephones opened this issue Aug 21, 2023 · 1 comment
Labels
need-information Further information is requested

Comments

@lephones
Copy link

lephones commented Aug 21, 2023

Check List

Please check followings before submitting a new issue.

Expected behavior

new_post_name: :year-:title.md
file path : _post/hexo/2023-hello.md (must be in sub folder)
permalink :
:title hexo/hello
:name hello

Actual behavior

i set a time prefix in post file name.prefix cant be removed in path.
permalink:
:title hexo-2023-hello
:name hexo-2023-hello

How to reproduce?

  1. edit the new_post_name setting in _config.ym to add ':year-:month-:day-:title.md' prefix.
  2. created a folder in _post and add a new post.
    The name and title in permalink setting is folder-date-name. (slug = title = name)
    eg.
# without year prefix
new_post_name: :title.md
post file : _post/hexo/hello.md
# permalink setting
:title hexo/hello
:name hello

# include prefix
new_post_name: :year-:title.md
post file :  _post/hexo/2023-hello.md
# permalink setting
:title hexo-2023-hello
:name hexo-2023-hello

hexo version 6.3

@uiolee uiolee added the need-information Further information is requested label Sep 28, 2023
@lephones
Copy link
Author

set ':year-:month-:day-:title.md' prefix in new_post_name.
create a sub-dir in _post-dir and create a md file with prefix.
the post url is /subdir-year-month-day-filename.html .
it should be /subdir/year-month-day-filename.html

the result without new_post_name is right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-information Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants