fluid-dev / hexo-theme-fluid

:ocean: 一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo
https://hexo.fluid-dev.com/
GNU General Public License v3.0
7.41k stars 1.13k forks source link

语言导致的构建问题 #1002

Closed Grey-Wind closed 1 year ago

Grey-Wind commented 1 year ago

请确认

问题描述

添加language: zh-CN后构建报错,删除后正常

FATAL
YAMLException: duplicated mapping key (101:1)

  98 | ## Plugins: https://hexo.io/plu ...
  99 | ## Themes: https://hexo.io/themes/
 100 | theme: fluid  # 指定主题
 101 | language: zh-CN  # 指定语言,会影响主题显示 ...
 102 |
 103 | # Deployment
    at generateError (E:\Project\Announcement\node_modules\js-yaml\lib\loader.js:183:10)
    at throwError (E:\Project\Announcement\node_modules\js-yaml\lib\loader.js:187:9)
    at storeMappingPair (E:\Project\Announcement\node_modules\js-yaml\lib\loader.js:358:7)
    at readBlockMapping (E:\Project\Announcement\node_modules\js-yaml\lib\loader.js:1173:9)
    at composeNode (E:\Project\Announcement\node_modules\js-yaml\lib\loader.js:1441:12)
    at readDocument (E:\Project\Announcement\node_modules\js-yaml\lib\loader.js:1625:3)
    at loadDocuments (E:\Project\Announcement\node_modules\js-yaml\lib\loader.js:1688:5)
    at Object.load (E:\Project\Announcement\node_modules\js-yaml\lib\loader.js:1714:19)
    at Hexo.yamlHelper (E:\Project\Announcement\node_modules\hexo\lib\plugins\renderer\yaml.js:20:15)
    at Hexo.tryCatcher (E:\Project\Announcement\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (E:\Project\Announcement\node_modules\bluebird\js\release\method.js:15:34)
    at E:\Project\Announcement\node_modules\hexo\lib\hexo\render.js:81:22
    at tryCatcher (E:\Project\Announcement\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (E:\Project\Announcement\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (E:\Project\Announcement\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromise0 (E:\Project\Announcement\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (E:\Project\Announcement\node_modules\bluebird\js\release\promise.js:729:18)
    at _drainQueueStep (E:\Project\Announcement\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (E:\Project\Announcement\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (E:\Project\Announcement\node_modules\bluebird\js\release\async.js:102:5)
    at Async.drainQueues [as _onImmediate] (E:\Project\Announcement\node_modules\bluebird\js\release\async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
Grey-Wind commented 1 year ago

当我使用languages: zh-CN时变成了德语

Grey-Wind commented 1 year ago

目前推测,文件夹名称为languages,所以language无法使用,当使用languages时自动检索了第一个,但是不知道为什么使用zh-TW时回到了英文而不是德语

Grey-Wind commented 1 year ago

我目前的解决办法是删除除了zh-CN以外所有的yml文件

Grey-Wind commented 1 year ago

hexo、node都是最新版,fluid同样是最新的release

Grey-Wind commented 1 year ago

有人处理这个问题吗

jmb0217 commented 1 year ago

有人处理这个问题吗

me too

jmb0217 commented 1 year ago

更改site域内的language选项 不要新增

zkqiang commented 1 year ago
YAMLException: duplicated mapping key

很明显你是有两个 language 配置导致重复了