Hexo next主题 languages/zh-Hans.yml报错

发布于 2022-09-04 13:01:45 字数 2383 浏览 24 评论 0

当站点配置文件改为language: en或者language: zh-Hans时,都会报错,

 ERROR Process failed: languages/zh-Hans.yml
Error
    at generateError (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:162:10)
    at throwError (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:168:9)
    at storeMappingPair (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:307:7)
    at readBlockMapping (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1070:9)
    at composeNode (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12)
    at readBlockMapping (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1061:11)
    at composeNode (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12)
    at readDocument (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1493:3)
    at loadDocuments (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1549:5)
    at Object.load (/Users/Documents/hexo/node_modules/js-yaml/lib/js-yaml/loader.js:1566:19)
    at Hexo.yamlHelper (/Users/Documents/hexo/node_modules/hexo/lib/plugins/renderer/yaml.js:7:15)
    at Hexo.tryCatcher (/Users/Documents/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/Documents/hexo/node_modules/bluebird/js/release/method.js:15:34)
    at /Users/Documents/hexo/node_modules/hexo/lib/hexo/render.js:61:21
    at tryCatcher (/Users/Documents/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/Documents/hexo/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/Users/Documents/hexo/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/Documents/hexo/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/Documents/hexo/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/Users/Documents/hexo/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/Users/Documents/hexo/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/Users/Documents/hexo/node_modules/bluebird/js/release/async.js:17:14)

如果把languages文件夹中zh-Hans.yml文件删除,则不会报错,已经尝试过从github上重新下载NEXT主题中的zh-Hans.yml的文件进行替换,但是依然报错,求问这是什么情况?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

以酷 2022-09-11 13:01:45

遇到了同样的问题. 不知道怎么解决

找到问题了,是因为 _config.yml 文件问题缺少了配置. 里面menu配置将#号打开
删除掉themes/next/language中 zh-Hans.yml 里面的其他内容, 剩下这些就不会报错.

clipboard.png

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文