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

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

Open
warrenwx opened this issue Feb 1, 2019 · 12 comments
Open

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

warrenwx opened this issue Feb 1, 2019 · 12 comments

Comments

@warrenwx
Copy link

warrenwx commented Feb 1, 2019

  • hexo new post "xxx"
  • hexo generate
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)
  • cause
    A space is missing after the semicolon of tag fileds of the "new post" auto genrated by hexo.
@tcrowe
Copy link

tcrowe commented Feb 1, 2019

@warrenwx Can you explain more please?

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

@warrenwx
Copy link
Author

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
Copy link
Author

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

@warrenwx
Copy link
Author


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

This is a sample generated automatically.

@tcrowe
Copy link

tcrowe commented Feb 12, 2019

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
Copy link
Member

yoshinorin commented Feb 13, 2019

@warrenwx @tcrowe
I found same issues hexojs/hexo#1753 (comment)
This error maybe caused by _config.yml formatting.

Could you please show your _config.yml to us?

@warrenwx
Copy link
Author

_config.txt
sorry for that.

@yoshinorin
Copy link
Member

yoshinorin commented Feb 13, 2019

@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
Copy link
Author

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 yoshinorin changed the title BUG, please repair Add space to after tags field is better Feb 13, 2019
@yoshinorin
Copy link
Member

@warrenwx
Thanks a lot 😄

@yoshinorin yoshinorin changed the title Add space to after tags field is better Add space to after tags field is better when create new post Feb 13, 2019
@stevenjoezhang
Copy link
Member

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

@stevenjoezhang stevenjoezhang transferred this issue from hexojs/hexo Mar 26, 2020
@rangerz

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants