Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[功能建议] 默认的 menu #24

Closed
a-wing opened this issue May 3, 2023 · 2 comments
Closed

[功能建议] 默认的 menu #24

a-wing opened this issue May 3, 2023 · 2 comments

Comments

@a-wing
Copy link

a-wing commented May 3, 2023

功能概述
请提供这个功能应该是什么样的

目前主题的配置,默认的 menu 部分。

menu:
  Index:
    url: /
    External: false
    name: 首页
  Tags:
    url: /tags
    External: false
    name: 标签
  Archives:
    url: /archives
    External: false
    name: 归档
  About:
    url: /about
    External: false
    name: 关于

但实际上如果使用 _config.minimalism.yml 进行覆盖的化

比如这样:

menu:
  Index:
    url: /
    External: false
    name: 首页
  Tags:
    url: /tags/
    External: false
    name: 标签
  Equipment:
    url: /equipment/
    External: false
    name: 装备
  Projects:
    url: /projects/
    External: false
    name: 作品
  Archives:
    url: /archives/
    External: false
    name: 归档
  About:
    url: /about/
    External: false
    name: 关于

但最终结果是这样的:

menu:
  Index:
    url: /
    External: false
    name: 首页
  Tags:
    url: /tags
    External: false
    name: 标签
  Archives:
    url: /archives
    External: false
    name: 归档
  About:
    url: /about
    External: false
    name: 关于
  Equipment:
    url: /equipment/
    External: false
    name: 装备
  Projects:
    url: /projects/
    External: false
    name: 作品

如果使用 npm 安装的化,实际上并没有办法去改变 menu 的顺序。hexo 会把两个 _config.yml 进行合并。甚至不能去掉已经存在的按钮。建议默认配置里面把 menu 留空


BTW: 用 Map 来做有顺序的配置这在语法上并不严格。建议使用 Array

例如这样:

menu:
 -
    url: /
    External: false
    name: 首页
 -
    url: /tags
    External: false
    name: 标签
 -
    url: /archives
    External: false
    name: 归档
 -
    url: /about
    External: false
    name: 关于
@f-dong
Copy link
Owner

f-dong commented May 3, 2023

收到,下个版本会优化掉这个问题

f-dong added a commit that referenced this issue May 4, 2023
@f-dong
Copy link
Owner

f-dong commented May 26, 2023

此问题已修复,更新v1.3.6版本即可

@f-dong f-dong closed this as completed May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants