volantis-x / hexo-theme-volantis

A Wonderful Theme for Hexo.
https://volantis.js.org
MIT License
2.05k stars 599 forks source link

文章命名为纯数字时使用hexo g报错 #725

Closed Asteri5m closed 2 years ago

Asteri5m commented 2 years ago

自检报告

第一步:查阅文档

第二步:测试原生代码

打开终端,执行下面的命令:

git clone https://github.com/volantis-x/demo.git && cd demo && npm i && hexo s

结果是否能够正常运行?

测试结果是:A or B

问题描述

本地的md文件的名字导致hexo g失败,对于含有中文名的文件没有出过报错,因为我想用日期命名所以就是纯数字,但是在hexo g时报错,这个报错偶尔会因为运气好而编译过,但大多数时候都会报错,报错全文如下:

ERROR { err: ValidationError: slug is required! at new WarehouseError (E:\blog\node_modules\warehouse\lib\error.js:14:11) at new ValidationError (E:\blog\node_modules\warehouse\lib\error\validation.js:5:1) at SchemaTypeString.validate (E:\blog\node_modules\warehouse\lib\schematype.js:100:13) at SchemaTypeString.validate (E:\blog\node_modules\warehouse\lib\types\string.js:33:25) at Array. (E:\blog\node_modules\warehouse\lib\schema.js:510:27) at Schema._applySetters (E:\blog\node_modules\warehouse\lib\schema.js:640:15) at _Model._insertOne (E:\blog\node_modules\warehouse\lib\model.js:158:12) at E:\blog\node_modules\warehouse\lib\model.js:179:63 at tryCatcher (E:\blog\node_modules\bluebird\js\release\util.js:16:23) at E:\blog\node_modules\bluebird\js\release\using.js:185:26 at tryCatcher (E:\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (E:\blog\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (E:\blog\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (E:\blog\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (E:\blog\node_modules\bluebird\js\release\promise.js:729:18) at Promise._fulfill (E:\blog\node_modules\bluebird\js\release\promise.js:673:18) at PromiseArray._resolve (E:\blog\node_modules\bluebird\js\release\promise_array.js:127:19) at PromiseArray._promiseFulfilled (E:\blog\node_modules\bluebird\js\release\promise_array.js:145:14) at Promise._settlePromise (E:\blog\node_modules\bluebird\js\release\promise.js:609:26) at Promise._settlePromise0 (E:\blog\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (E:\blog\node_modules\bluebird\js\release\promise.js:729:18) at _drainQueueStep (E:\blog\node_modules\bluebird\js\release\async.js:93:12) at _drainQueue (E:\blog\node_modules\bluebird\js\release\async.js:86:9) at Async._drainQueues (E:\blog\node_modules\bluebird\js\release\async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (E:\blog\node_modules\bluebird\js\release\async.js:15:14) at processImmediate (internal/timers.js:461:21) { code: undefined } } Process failed: %s _posts/20211116.md

环境信息

主题版本

您当前使用的版本为: hexo: 5.4.0

复现地址

截图

相关截图

浏览器、操作系统

配置文件

配置文件 #### 站点配置文件 在这里粘贴 `blog/_config.yml` 中修改过的部分 ```yml ``` #### 主题配置文件 在这里粘贴 `themes/volantis/_config.yml` 中修改过的部分 ```yml permalink: archives/:title.html new_post_name: :year:month:day.md # File name of new posts #Music aplayer: meting: true # MetingJS 支持 asset_inject: false ``` #### node.js & npm 在这里粘贴 `node -v && npm -v` 输出的信息 ``` node -v v14.15.1 npm -v 6.14.8 ``` #### package.json 在这里粘贴 `npm ls --depth 0` 输出的信息 ``` hexo-site@0.0.0 E:\blog +-- aplayer@1.10.1 +-- hexo@5.4.0 +-- hexo-deployer-git@3.0.0 +-- hexo-generator-archive@1.0.0 +-- hexo-generator-category@1.0.0 +-- hexo-generator-index@2.0.0 +-- hexo-generator-tag@1.0.0 +-- hexo-renderer-ejs@1.0.0 +-- hexo-renderer-marked@4.1.0 +-- hexo-renderer-stylus@2.0.1 +-- hexo-server@2.0.0 +-- hexo-tag-aplayer@3.0.4 +-- hexo-theme-fluid@1.8.12 `-- hexo-theme-landscape@0.0.3 npm ERR! missing: bindings@^1.5.0, required by fsevents@1.2.13 npm ERR! missing: nan@^2.12.1, required by fsevents@1.2.13 ```
MHuiG commented 2 years ago

加上 :title 就好了,似乎是hexo的问题

new_post_name: :title:year:month:day.md