Closed kristofzerbe closed 7 months ago
One more thing, I didn't mentioned: The post_link's in my MD's are looking always like this:
{% post_link 2023/My-fancy-post %}
... as Steven pointed out in https://github.com/hexojs/hexo/issues/5042#issuecomment-1322432714
It seems that if you change the config entry new_post_name from :title.md
to :year/:title.md
, you need to remove the subfolder prefix in post_link like {% post_link My-fancy-post %}
Oh yes, you're right. Works, even if I couldn't directly establish a connection between the config entry and the tag in my head and in the code.
Check List
hexo version
to check)Expected behavior
My post folder structure relies on subfolders per year, like
_posts/2023/my-fancy-post.md
, with asset folders of the same name, and I use the Tag Pluginpost_link
in many posts.Since
hexo new post XXX
always creates the new post in the root post folder, I recently changed the config entrynew_post_name
from:title.md
to:year/:title
to create the new posts directly in the correct folder.I expected that the new post is created in the appropriate subfolder (works) and Hexo generates my files (works not)
Actual behavior
After the change my build, which executes
hexo clean && hexo generate
, aborts with the following message:The error occurs comprehensible in Hexo 6.3.0 as well as in 7.0.0.
:title
= generation works,:year/:title
generation stops with error.How to reproduce?
/_config.yml
withnew_post_name: :year/:title.md
hexo generate
Is the problem still there under
Safe mode
?Yes
Your Node.js & npm version
Your Hexo and Plugin version
Your
package.json
Your site's
_config.yml
(Optional)Others
I was hoping issues like https://github.com/hexojs/hexo/issues/5042 would help me, but that wasn't the case