INFO Validating config INFO Start processing ERROR Process failed: _posts/[Hexo]-常用-Hexo-指令.md YAMLException: bad indentation of a mapping entry (1:15)
1 | title: [Hexo] 常用 Hexo 指令 -------------------^ 2 | date: 2022-11-29 10:26:27 3 | tags: at generateError (D:\blog\node_modules\js-yaml\lib\loader.js:183:10) at throwError (D:\blog\node_modules\js-yaml\lib\loader.js:187:9) at readBlockMapping (D:\blog\node_modules\js-yaml\lib\loader.js:1182:7) at composeNode (D:\blog\node_modules\js-yaml\lib\loader.js:1441:12) at readDocument (D:\blog\node_modules\js-yaml\lib\loader.js:1625:3) at loadDocuments (D:\blog\node_modules\js-yaml\lib\loader.js:1688:5) at Object.load (D:\blog\node_modules\js-yaml\lib\loader.js:1714:19) at parseYAML (D:\blog\node_modules\hexo-front-matter\lib\front_matter.js:69:23) at parse (D:\blog\node_modules\hexo-front-matter\lib\front_matter.js:50:12) at D:\blog\node_modules\hexo\lib\plugins\processor\post.js:93:18 at tryCatcher (D:\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (D:\blog\node_modules\bluebird\js\release\promise.js:544:35) at Promise._settlePromise (D:\blog\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (D:\blog\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (D:\blog\node_modules\bluebird\js\release\promise.js:729:18) at Promise._fulfill (D:\blog\node_modules\bluebird\js\release\promise.js:673:18) at PromiseArray._resolve (D:\blog\node_modules\bluebird\js\release\promise_array.js:127:19) at PromiseArray._promiseFulfilled (D:\blog\node_modules\bluebird\js\release\promise_array.js:145:14) at PromiseArray._iterate (D:\blog\node_modules\bluebird\js\release\promise_array.js:115:31) at PromiseArray.init [as _init] (D:\blog\node_modules\bluebird\js\release\promise_array.js:79:10) at Promise._settlePromise (D:\blog\node_modules\bluebird\js\release\promise.js:601:21) at Promise._settlePromise0 (D:\blog\node_modules\bluebird\js\release\promise.js:649:10)
解決方法
將 md. 檔案最上方 front_matter 中 title 的內容以引號包裹可避免發生此錯誤:
INFO Validating config FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html YAMLException: bad indentation of a mapping entry (1:15) 1 | title: [Hexo] title 包含特殊字元引發錯誤 -------------------^ 2 | date: 2022-11-29 04:11:40 3 | tags: at generateError (D:\blog\node_modules\js-yaml\lib\loader.js:183:10) at throwError (D:\blog\node_modules\js-yaml\lib\loader.js:187:9) at readBlockMapping (D:\blog\node_modules\js-yaml\lib\loader.js:1182:7) at composeNode (D:\blog\node_modules\js-yaml\lib\loader.js:1441:12) at readDocument (D:\blog\node_modules\js-yaml\lib\loader.js:1625:3) at loadDocuments (D:\blog\node_modules\js-yaml\lib\loader.js:1688:5) at load (D:\blog\node_modules\js-yaml\lib\loader.js:1714:19) at D:\blog\node_modules\hexo\lib\hexo\post.js:282:63 at tryCatcher (D:\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (D:\blog\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (D:\blog\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (D:\blog\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (D:\blog\node_modules\bluebird\js\release\promise.js:729:18) at Promise._fulfill (D:\blog\node_modules\bluebird\js\release\promise.js:673:18) at Promise._settlePromise (D:\blog\node_modules\bluebird\js\release\promise.js:617:21) at Promise._settlePromise0 (D:\blog\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (D:\blog\node_modules\bluebird\js\release\promise.js:729:18) at Promise._fulfill (D:\blog\node_modules\bluebird\js\release\promise.js:673:18) at D:\blog\node_modules\bluebird\js\release\nodeback.js:42:21 at D:\blog\node_modules\nunjucks\src\environment.js:41:5 at RawTask.call (D:\blog\node_modules\asap\asap.js:40:19) at flush (D:\blog\node_modules\asap\raw.js:50:29)
解決方法
我目前只能手動建立新 .md 檔案,並貼上模板,md. 檔案中 title 的內容依然需要以引號包裹才可避免發生其他錯誤。
PS D:\blog> hexo deploy INFO Validating config INFO ================================== ███╗ ██╗███████╗██╗ ██╗████████╗ ████╗ ██║██╔════╝╚██╗██╔╝╚══██╔══╝ ██╔██╗ ██║█████╗ ╚███╔╝ ██║ ██║╚██╗██║██╔══╝ ██╔██╗ ██║ ██║ ╚████║███████╗██╔╝ ██╗ ██║ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝ ======================================== NexT version 8.13.2 Documentation: https://theme-next.js.org ======================================== INFO Start processing ERROR Process failed: _posts/Hexo-Debug-03-sitemap-xml-xmlParseEntityRef-error.md YAMLException: bad indentation of a mapping entry (1:57)
1 | ... map.xml error xmlParseEntityRef: no name -----------------------------------------^ 2 | ... 3 | ... at generateError (D:\blog\node_modules\js-yaml\lib\loader.js:183:10) at throwError (D:\blog\node_modules\js-yaml\lib\loader.js:187:9) at readBlockMapping (D:\blog\node_modules\js-yaml\lib\loader.js:1182:7) at composeNode (D:\blog\node_modules\js-yaml\lib\loader.js:1441:12) at readDocument (D:\blog\node_modules\js-yaml\lib\loader.js:1625:3) at loadDocuments (D:\blog\node_modules\js-yaml\lib\loader.js:1688:5) at Object.load (D:\blog\node_modules\js-yaml\lib\loader.js:1714:19) at parseYAML (D:\blog\node_modules\hexo-front-matter\lib\front_matter.js:69:23) at parse (D:\blog\node_modules\hexo-front-matter\lib\front_matter.js:50:12) at D:\blog\node_modules\hexo\lib\plugins\processor\post.js:93:18 at tryCatcher (D:\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (D:\blog\node_modules\bluebird\js\release\promise.js:544:35) at Promise._settlePromise (D:\blog\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (D:\blog\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (D:\blog\node_modules\bluebird\js\release\promise.js:729:18) at Promise._fulfill (D:\blog\node_modules\bluebird\js\release\promise.js:673:18) at PromiseArray._resolve (D:\blog\node_modules\bluebird\js\release\promise_array.js:127:19) at PromiseArray._promiseFulfilled (D:\blog\node_modules\bluebird\js\release\promise_array.js:145:14) at PromiseArray._iterate (D:\blog\node_modules\bluebird\js\release\promise_array.js:115:31) at PromiseArray.init [as _init] (D:\blog\node_modules\bluebird\js\release\promise_array.js:79:10) at Promise._settlePromise (D:\blog\node_modules\bluebird\js\release\promise.js:601:21) at Promise._settlePromise0 (D:\blog\node_modules\bluebird\js\release\promise.js:649:10)
解決方法
將 md. 檔案最上方 front_matter 中 title 的內容以引號包裹可避免發生此錯誤:
front_matter
1
title:'Hexo Debug 03:sitemap.xml error xmlParseEntityRef: no name'