hexo
hexo copied to clipboard
`hexo server` error when I change the config
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.
@breestealth Hello, problem still exist?
i also have this problem.And when i add a new post,and after hexo g d,could not synchronise to my github
hello , this problem also exists.
I alse have this problem. And I'm only new a post on my pc.
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?
@souvenir13 Thanks! the problem disappeared after I changed back to ":titile.md"!
I believe the answer lies somewhere around here: https://github.com/hexojs/hexo/blob/0b26940f7e0a35f6937b944012468bbf0d844010/lib/plugins/processor/post.js#L53
But I'm unable to understand why
我改回titile.md也不报错了
Reproduced in Hexo 5.2.0
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