Hexo部署在github上

时间:2019-09-04 12:43:14

标签: github hexo

在使用github和hexo建立个人博客时,在写入配置文件后,在cmd命令下运行hexo d -g命令是错误的。错误如下:

D:\hexo>hexo d -g
FATAL can not read a block mapping entry; a multiline key may not be an implicit key at line 94, column 1:

    ^
YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 94, column 1:

    ^
    at generateError (D:\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:167:10)
    at throwError (D:\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:173:9)
    at readBlockMapping (D:\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1073:9)
    at composeNode (D:\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1359:12)
    at readDocument (D:\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1519:3)
    at loadDocuments (D:\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1575:5)
    at Object.load (D:\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1596:19)
    at Hexo.yamlHelper (D:\hexo\node_modules\hexo\lib\plugins\renderer\yaml.js:7:15)
    at Hexo.tryCatcher (D:\hexo\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (D:\hexo\node_modules\bluebird\js\release\method.js:15:34)
    at Promise.then.text (D:\hexo\node_modules\hexo\lib\hexo\render.js:60:20)
    at tryCatcher (D:\hexo\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\hexo\node_modules\bluebird\js\release\promise.js:517:31)
    at Promise._settlePromise (D:\hexo\node_modules\bluebird\js\release\promise.js:574:18)
    at Promise._settlePromise0 (D:\hexo\node_modules\bluebird\js\release\promise.js:619:10)
    at Promise._settlePromises (D:\hexo\node_modules\bluebird\js\release\promise.js:699:18)
    at _drainQueueStep (D:\hexo\node_modules\bluebird\js\release\async.js:138:12)
    at _drainQueue (D:\hexo\node_modules\bluebird\js\release\async.js:131:9)
    at Async._drainQueues (D:\hexo\node_modules\bluebird\js\release\async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (D:\hexo\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)

1 个答案:

答案 0 :(得分:0)

尝试在之后添加空格:,使_config.yml文件看起来像:

title: abc
tags: a

还有一件事,请确保您的文件编码是UTF-8 withou BOM

请参见https://github.com/hexojs/hexo/issues/1192