Hexo: "hexo new page" error

Created on 10 Oct 2019  ·  6Comments  ·  Source: hexojs/hexo

Check List

Please check followings before submitting a new issue.

  • [x] I have already read Docs page & Troubleshooting page
  • [x] I have already searched existing issues and they are not help to me
  • [x] I examined error or warning messages and it's difficult to solve
  • [x] Node.js is higher than 6.9

Question

When I type hexo new page "_else"
I want it to build a forder named "_else" in the forder "sourses"

t didn't do it and report error, which I find in troubleshooting says that "Make sure you are using soft tabs and add a space after colons." . But I did check them and the problem still.

this is the error report:
(the /aiguosb is my blog's root forder)

$ hexo new page "_else"
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 5, column 1:

^
at generateError (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesjs-yamllibjs-yamlloader.js:167:10)
at throwError (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesjs-yamllibjs-yamlloader.js:173:9)
at readBlockMapping (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesjs-yamllibjs-yamlloader.js:1073:9)
at composeNode (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesjs-yamllibjs-yamlloader.js:1359:12)
at readDocument (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesjs-yamllibjs-yamlloader.js:1519:3)
at loadDocuments (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesjs-yamllibjs-yamlloader.js:1575:5)
at Object.load (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesjs-yamllibjs-yamlloader.js:1596:19)
at _getScaffold.then.then.frontMatter (C:UsersAdministratorDocumentsGitHubaiguosbnode_moduleshexolibhexopost.js:125:66)
at tryCatcher (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleaseutil.js:16:23)
at Promise._settlePromiseFromHandler (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:517:31)
at Promise._settlePromise (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:574:18)
at Promise._settlePromise0 (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:619:10)
at Promise._settlePromises (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:699:18)
at Promise._fulfill (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:643:18)
at Promise._resolveCallback (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:437:57)
at Promise._settlePromiseFromHandler (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:529:17)
at Promise._settlePromise (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:574:18)
at Promise._settlePromise0 (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:619:10)
at Promise._settlePromises (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:699:18)
at Promise._fulfill (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:643:18)
at Promise._settlePromise (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:587:21)
at Promise._settlePromise0 (C:UsersAdministratorDocumentsGitHubaiguosbnode_modulesbluebirdjsreleasepromise.js:619:10)

Steps to reproduce the behavior

  1. I open git bash on my blog's root forder.
  2. I type hexo new page "_else" and enter.
  3. The git bash just report error.

Hexo Configuration

I have check all the space after colon:

NexT Configuration

I have check all the part that I've changed
there do are space after colon:

Environment & Settings

Node.js & npm version

$ node -v
v10.16.3

$ npm -v
6.9.0

Your site _config.yml (Optional)


Your theme _config.yml (Optional)


Hexo and Plugin version(npm ls --depth 0)


Your package.json package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.9.0"
  },
  "dependencies": {
    "hexo": "^3.9.0",
    "hexo-blog-encrypt": "^3.0.3",
    "hexo-deployer-git": "^2.0.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index-pin-top": "^0.2.2",
    "hexo-generator-searchdb": "^1.0.8",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-marked": "^1.0.1",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-server": "^0.3.3"
  }
}

Others

question

All 6 comments

the theme next and landscape both meet this problem and I promise I haven't changed anything in landscape

@1am-one Hi 👋
Would you please tell me your scaffolds/page.md?
I think maybe scaffolds/page.md's yaml syntax is something wrong.

Thanks :)

@1am-one Hi wave
Would you please tell me your scaffolds/page.md?
I think maybe scaffolds/page.md's yaml syntax is something wrong.

Thanks :)


title: {{ title }}
date: {{ date }}
ptype: page

purl: {{ type }}

The "ptype" and "purl" is my own-defined permalink

So, your post.md front-matter is following. Is it right?

---
title: {{ title }}
date: {{ date }}
ptype: page
purl: {{ type }}
---

Do you add --- separator?
Would you please delete db.json before hexo new page _else?

@1am-one Hi wave
Would you please tell me your scaffolds/page.md?
I think maybe scaffolds/page.md's yaml syntax is something wrong.

Thanks :)

uh...yes. I reset all the space after the colon. And the problem solved!
Maybe some space are not soft one.
Anyway, thank you very much!

You are welcome. Thanks :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jo4x962k7JL picture jo4x962k7JL  ·  3Comments

ghost picture ghost  ·  3Comments

leoli-dev picture leoli-dev  ·  3Comments

cxgreat2014 picture cxgreat2014  ·  3Comments

bearpaw picture bearpaw  ·  3Comments