hexojs / hexo-starter

Hexo Starter site (use `npx hexo init myBlog`)
178 stars 209 forks source link

Add space to after tags field is better when create new post #32

Open warrenwx opened 5 years ago

warrenwx commented 5 years ago
YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 4, column 1:
    ^
    at generateError (/opt/github_io/warrenwx_hexo/node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
    at throwError (/opt/github_io/warrenwx_hexo/node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
    at readBlockMapping (/opt/github_io/warrenwx_hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1046:9)
    at composeNode (/opt/github_io/warrenwx_hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12)
    at readDocument (/opt/github_io/warrenwx_hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1492:3)
    at loadDocuments (/opt/github_io/warrenwx_hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
    at Object.load (/opt/github_io/warrenwx_hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1569:19)
    at parseYAML (/opt/github_io/warrenwx_hexo/node_modules/hexo-front-matter/lib/front_matter.js:80:21)
    at parse (/opt/github_io/warrenwx_hexo/node_modules/hexo-front-matter/lib/front_matter.js:56:12)
    at Promise.all.spread (/opt/github_io/warrenwx_hexo/node_modules/hexo/lib/plugins/processor/post.js:52:20)
    at tryCatcher (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise.js:509:35)
    at Promise._settlePromise (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise.js:694:18)
    at Promise._fulfill (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise.js:638:18)
    at PromiseArray._resolve (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise_array.js:126:19)
    at PromiseArray._promiseFulfilled (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise_array.js:144:14)
    at PromiseArray._iterate (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise_array.js:114:31)
    at PromiseArray.init [as _init] (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise_array.js:78:10)
    at Promise._settlePromise (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise.js:566:21)
    at Promise._settlePromise0 (/opt/github_io/warrenwx_hexo/node_modules/bluebird/js/release/promise.js:614:10)
tcrowe commented 5 years ago

@warrenwx Can you explain more please?

What is your scaffold? This? https://github.com/hexojs/hexo-starter/tree/master/scaffolds

warrenwx commented 5 years ago

hexo: 3.7.1 hexo-cli: 1.1.0 os: Linux 3.10.0-862.14.4.el7.x86_64 linux x64 http_parser: 2.8.0 node: 8.12.0 v8: 6.2.414.66 uv: 1.19.2 zlib: 1.2.11 ares: 1.10.1-DEV modules: 57 nghttp2: 1.32.0 napi: 3 openssl: 1.0.2p icu: 60.1 unicode: 10.0 cldr: 32.0 tz: 2017c

warrenwx commented 5 years ago

I used "hexo" with pulling master branch from https://github.com/hexojs/hexo

warrenwx commented 5 years ago

title: NIO date: 2019-02-12 14:11:19 tags:

This is a sample generated automatically.

tcrowe commented 5 years ago

I'm not sure what is wrong. The original error looks like a YAML parsing error. Maybe if you open up the file that errors you can add console.log(...) to find more information. If you try again can you let me know @warrenwx ? Thank you

yoshinorin commented 5 years ago

@warrenwx @tcrowe I found same issues https://github.com/hexojs/hexo/issues/1753#issuecomment-381079224 This error maybe caused by _config.yml formatting.

Could you please show your _config.yml to us?

warrenwx commented 5 years ago

_config.txt sorry for that.

yoshinorin commented 5 years ago

@warrenwx OK. I got it. I misunderstood. It's so sorry... I will create PR for this issue.

And may I change this issue title more detailed?

PS. I can't judge add space to after tags field is better or not. So, I do not know whether it can will accept or not.

warrenwx commented 5 years ago

Anyway, for most beginners with hexo, the problem is common to meet. As for the title, please revise it for better recognition. Thanks a lot.

yoshinorin commented 5 years ago

@warrenwx Thanks a lot 😄

stevenjoezhang commented 4 years ago

If I understand correctly, this file needs to be modified: https://github.com/hexojs/hexo-starter/blob/master/scaffolds/post.md

I'm not sure how much this will help beginners with Hexo. YAML syntax errors caused by missing spaces can be avoided If the text editor can highlight front-matter

rangerz commented 1 year ago

Fixed in https://github.com/hexojs/hexo-starter/pull/67