lh1me / hexo-theme-aomori

🔥 Minimalist & Powerful Hexo Theme
https://hexo-theme-aomori-demo.pages.dev/
MIT License
379 stars 45 forks source link

在全局配置_cofing.yml中修改主题报错 #107

Closed NoctuG closed 2 years ago

NoctuG commented 2 years ago
$ hexo g
FATAL YAMLException: duplicated mapping key (110:1)

 107 | # hexo-theme-aomori
 108 | ## https://github.com/lh1me/hex ...
 109 | version: 1654266144177
 110 | language: cn
-------^
 111 | aomori_menu:
 112 |   Home: /
    at generateError (C:\Users\21225\OneDrive\Documents\mlou\node_modules\js-yaml\lib\loader.js:183:10)
    at throwError (C:\Users\21225\OneDrive\Documents\mlou\node_modules\js-yaml\lib\loader.js:187:9)
    at storeMappingPair (C:\Users\21225\OneDrive\Documents\mlou\node_modules\js-yaml\lib\loader.js:358:7)
    at readBlockMapping (C:\Users\21225\OneDrive\Documents\mlou\node_modules\js-yaml\lib\loader.js:1173:9)
    at composeNode (C:\Users\21225\OneDrive\Documents\mlou\node_modules\js-yaml\lib\loader.js:1441:12)
    at readDocument (C:\Users\21225\OneDrive\Documents\mlou\node_modules\js-yaml\lib\loader.js:1625:3)
    at loadDocuments (C:\Users\21225\OneDrive\Documents\mlou\node_modules\js-yaml\lib\loader.js:1688:5)
    at Object.load (C:\Users\21225\OneDrive\Documents\mlou\node_modules\js-yaml\lib\loader.js:1714:19)
    at Hexo.yamlHelper (C:\Users\21225\OneDrive\Documents\mlou\node_modules\hexo\lib\plugins\renderer\yaml.js:20:15)
    at Hexo.tryCatcher (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\method.js:15:34)
    at C:\Users\21225\OneDrive\Documents\mlou\node_modules\hexo\lib\hexo\render.js:81:22
    at tryCatcher (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromise0 (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\promise.js:729:18)
    at _drainQueueStep (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\21225\OneDrive\Documents\mlou\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (node:internal/timers:466:21) {
  reason: 'duplicated mapping key',
  mark: {
    name: null,
    buffer: '## Hexo Configuration\n' +
      '## Docs: https://hexo.io/docs/configuration.html\n' +
      '## Source: https://github.com/hexojs/hexo/\n' +
      '\n' +
      '# Site\n' +
      'title: Mlou\n' +
      "subtitle: ''\n" +
      "description: ''\n" +
      'keywords:\n' +
      'author: Jeed\n' +
      'language: zh-CN\n' +
      "timezone: ''\n" +
      '\n' +
      '# URL\n' +
      "## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'\n" +
      'url: http://example.com\n' +
      'permalink: :year/:month/:day/:title/\n' +
      'permalink_defaults:\n' +
      'pretty_urls:\n' +
      "  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks\n" +
      "  trailing_html: true # Set to false to remove trailing '.html' from permalinks\n" +
      '\n' +
      '# Directory\n' +
      'source_dir: source\n' +
      'public_dir: public\n' +
      'tag_dir: tags\n' +
      'archive_dir: archives\n' +
      'category_dir: categories\n' +
      'code_dir: downloads/code\n' +
      'i18n_dir: :lang\n' +
      'skip_render:\n' +
      '\n' +
      '# Writing\n' +
      'new_post_name: :title.md # File name of new posts\n' +
      'default_layout: post\n' +
      'titlecase: false # Transform title into titlecase\n' +
      'external_link:\n' +
      '  enable: true # Open external links in new tab\n' +
      '  field: site # Apply to the whole site\n' +
      "  exclude: ''\n" +
      'filename_case: 0\n' +
      'render_drafts: false\n' +
      'post_asset_folder: false\n' +
      'relative_link: false\n' +
      'future: true\n' +
      'highlight:\n' +
      '  enable: false\n' +
      '  line_number: true\n' +
      '  auto_detect: false\n' +
      "  tab_replace: ''\n" +
      '  wrap: true\n' +
      '  hljs: false\n' +
      'prismjs:\n' +
      '  enable: false\n' +
      '  preprocess: true\n' +
      '  line_number: true\n' +
      "  tab_replace: ''\n" +
      '\n' +
      '# Home page setting\n' +
      "# path: Root path for your blogs index page. (default = '')\n" +
      '# per_page: Posts displayed per page. (0 = disable pagination)\n' +
      '# order_by: Posts order. (Order by date descending by default)\n' +
      'index_generator:\n' +
      "  path: ''\n" +
      '  per_page: 10\n' +
      '  order_by: -date\n' +
      '\n' +
      '# Category & Tag\n' +
      'default_category: uncategorized\n' +
      'category_map:\n' +
      'tag_map:\n' +
      '\n' +
      '# Metadata elements\n' +
      '## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta\n' +
      'meta_generator: true\n' +
      '\n' +
      '# Date / Time format\n' +
      '## Hexo uses Moment.js to parse and display date\n' +
      '## You can customize the date format as defined in\n' +
      '## http://momentjs.com/docs/#/displaying/format/\n' +
      'date_format: YYYY-MM-DD\n' +
      'time_format: HH:mm:ss\n' +
      "## updated_option supports 'mtime', 'date', 'empty'\n" +
      "updated_option: 'mtime'\n" +
      '\n' +
      '# Pagination\n' +
      '## Set per_page to 0 to disable pagination\n' +
      'per_page: 10\n' +
      'pagination_dir: page\n' +
      '\n' +
      '# Include / Exclude file(s)\n' +
      "## include:/exclude: options only apply to the 'source/' folder\n" +
      'include:\n' +
      'exclude:\n' +
      'ignore:\n' +
      '\n' +
      '# Extensions\n' +
      '## Plugins: https://hexo.io/plugins/\n' +
      '## Themes: https://hexo.io/themes/\n' +
      'theme: aomori\n' +
      '\n' +
      '# Deployment\n' +
      '## Docs: https://hexo.io/docs/\n' +
      'deploy:\n' +
      "  type: ''\n" +
      '  \n' +
      '# hexo-theme-aomori\n' +
      '## https://github.com/lh1me/hexo-theme-aomori\n' +
      'version: 1654266144177\n' +
      'language: cn\n' +
      'aomori_menu:\n' +
      '  Home: /\n' +
      '  关于: /about\n' +
      '  标签: /tags\n' +
      '  分类: /categories\n' +
      'aomori_widgets:\n' +
      '  - toc\n' +
      '  - category\n' +
      '  - tag\n' +
      '  - recent_posts\n' +
      '  - archive\n' +

系统:Win11 NodeJs : v16.15.0

lh1me commented 2 years ago

报错内容里面有写了 duplicated mapping key 意思应该是有重复的配置项

NoctuG commented 2 years ago

报错内容里面有写了 duplicated mapping key 意思应该是有重复的配置项

对全局配置进行修改(全部内容如下)

## Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: Mlou
subtitle: ''
description: ''
keywords:
author: John Doe
language: zh-CN
timezone: ''

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: http://example.com
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: false
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: aomori

# Deployment
## Docs: https://hexo.io/docs/
deploy:
  type: ''

# Theme Setup
version: 1654266144177
aomori_widgets:
  - toc
  - category
  - tag
  - recent_posts
  - archive
aomori_copyright: true
aomori_favicon: 🌐

删除 aomori_busuanzi aomori_disqusjs language 3项后才停止报错