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 中如何用下划线分隔日期和标题 #1970

Closed
seisman opened this issue May 22, 2016 · 2 comments
Closed

new_post_name 中如何用下划线分隔日期和标题 #1970

seisman opened this issue May 22, 2016 · 2 comments
Labels
bug Something isn't working

Comments

@seisman
Copy link

seisman commented May 22, 2016

想要文件名格式为 2010-03-20_this-is-tilt.md

尝试将 new_post_name 设置为如下几个值都不行:

  1. :year-:month-:day_:title.md => 2016-05-undefinedtest.md
  2. :year-:month-:{day}_:title.md => 2016-05-:{day}_test.md
  3. :year-:month-:day\_:title.md => _posts/2016-05-22\_test.md

请问是否有解决办法?

@stale stale bot added the wontfix This will not be worked on label Sep 27, 2017
@NoahDragon NoahDragon added bug Something isn't working and removed wontfix This will not be worked on labels Sep 27, 2017
@hexojs hexojs deleted a comment from stale bot Sep 27, 2017
@NoahDragon NoahDragon mentioned this issue Sep 27, 2017
53 tasks
@bestony
Copy link

bestony commented Nov 29, 2019

开发记录

  1. 需要给 slugize 添加一个 options https://github.com/hexojs/hexo-util/blob/ea43fba3635c50f566ea18ceff2fe7d3e87f90d4/lib/slugize.js#L9
  2. 给几个 [Model] 调用的 接口添加一个新的参数
  3. 给 default config 添加上相关参数
  4. 依赖于
    slug: {type: String, required: true},
    的 require ,无法写测试用例,暂停。

@stevenjoezhang
Copy link
Member

stevenjoezhang commented Mar 31, 2020

测试显示 Hexo 4.2.0 中,设置

new_post_name: :year-:month-:day_:title.md

符合预期。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants