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

hexo server error when I change the config #1099

Closed
breestealth opened this issue Mar 10, 2015 · 10 comments · Fixed by #5055
Closed

hexo server error when I change the config #1099

breestealth opened this issue Mar 10, 2015 · 10 comments · Fixed by #5055
Labels
bug Something isn't working
Milestone

Comments

@breestealth
Copy link

I change the config file to this one(just for the changed parts):

# Writing
new_post_name: :year:month:day.md # File name of new posts

In this way, when I add a new post, the post file name would be like this "20150310.md"

However, when I run hexo server I will got an error like this:

ERROR Process failed: _posts/20140130.md
ValidationError: `slug` is required!
    at SchemaTypeString.SchemaType.validate (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/warehouse/lib/schematype.js:125:12)
    at SchemaTypeString.validate (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/warehouse/lib/types/string.js:49:45)
    at Array.<anonymous> (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/warehouse/lib/schema.js:198:23)
    at Schema._applySetters (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/warehouse/lib/schema.js:369:19)
    at /Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/warehouse/lib/model.js:229:24
    at tryCatcher (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._settlePromiseFromHandler (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
    at Promise._settlePromiseAt (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
    at Promise._settlePromiseAtPostResolution (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:224:10)
    at Async._drainQueue (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:84:12)
    at Async._drainQueues (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:89:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/xxxxx/Documents/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:14:14)
    at processImmediate [as _immediateCallback] (timers.js:358:17)

I run hexo clean before every other command. So there would be nothing about the cache.

@tommy351 tommy351 added the bug Something isn't working label Mar 11, 2015
@Xuanwo
Copy link
Contributor

Xuanwo commented Dec 15, 2015

@breestealth Hello, problem still exist?

@XieJunhua
Copy link

i also have this problem.And when i add a new post,and after hexo g d,could not synchronise to my github

@cjYao
Copy link

cjYao commented Sep 2, 2016

hello , this problem also exists.

@e29hz
Copy link

e29hz commented Sep 5, 2016

I alse have this problem. And I'm only new a post on my pc.

@NoahDragon NoahDragon added this to the 4.0 milestone Apr 6, 2017
@NoahDragon NoahDragon mentioned this issue Apr 6, 2017
53 tasks
@souvenir13
Copy link

Hi, I also have this problem. and when I restore the new_post_name to ":titile.md", the error is gone. Maybe ":year:month:day.md" will name the file repeatedly? Do you resolve this problerm?

@USnb5
Copy link

USnb5 commented Jan 11, 2018

@souvenir13 Thanks! the problem disappeared after I changed back to ":titile.md"!

@tomap
Copy link
Contributor

tomap commented Sep 15, 2018

I believe the answer lies somewhere around here:

const info = parseFilename(config.new_post_name, path);

But I'm unable to understand why

@Devil-C
Copy link

Devil-C commented May 30, 2019

我改回titile.md也不报错了

@stevenjoezhang
Copy link
Member

stevenjoezhang commented Mar 31, 2020

Reproduced in Hexo 5.2.0

@GoldAndRabbit
Copy link

Hi, I also have this problem. and when I restore the new_post_name to ":titile.md", the error is gone. Maybe ":year:month:day.md" will name the file repeatedly? Do you resolve this problerm?

thanks

D-Sketon pushed a commit to D-Sketon/hexo that referenced this issue Sep 9, 2022
D-Sketon pushed a commit to D-Sketon/hexo that referenced this issue Sep 9, 2022
yoshinorin pushed a commit that referenced this issue Oct 5, 2022
* fix(#1099): hexo server error when changing the config

* fix(#1099): hexo server error when changing the config

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
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

Successfully merging a pull request may close this issue.