feat: 将导航配置合并到站点配置中

- 将导航配置从独立的 navigation.yml 合并到 site.yml 中
- 更新 generator.js 以优先使用 site.yml 中的导航配置
- 添加回退机制,当 site.yml 中无导航配置时仍支持独立的 navigation.yml
This commit is contained in:
coolzr
2025-10-23 02:01:46 +08:00
parent 75bc6c0e39
commit cceb83f9a5
3 changed files with 34 additions and 26 deletions

View File

@@ -1,21 +0,0 @@
# 默认导航配置(请勿直接修改)。
# 建议复制到 config/user/navigation.yml 并按需调整。
# 规则:
# - 每个导航项的 id 必须唯一,并与 pages/<id>.yml 对应
# - 全局仅允许一个 active: true 作为默认激活页面
- name: 首页 # 菜单名称
icon: fas fa-home # Font Awesome 图标类
id: home # 页面标识符(唯一,需与 pages/home.yml 对应)
active: true # 是否默认激活(全局仅一个 true
- name: 项目
icon: fas fa-project-diagram
id: projects
- name: 文章
icon: fas fa-book
id: articles
- name: 朋友
icon: fas fa-users
id: friends
- name: 书签
icon: fas fa-bookmark
id: bookmarks

View File

@@ -50,3 +50,22 @@ social:
- name: Steam
url: https://steam.com
icon: fab fa-steam
# 导航配置
navigation:
- name: 首页 # 菜单名称
icon: fas fa-home # Font Awesome 图标类
id: home # 页面标识符(唯一,需与 pages/home.yml 对应)
active: true # 是否默认激活(全局仅一个 true
- name: 项目
icon: fas fa-project-diagram
id: projects
- name: 文章
icon: fas fa-book
id: articles
- name: 朋友
icon: fas fa-users
id: friends
- name: 书签
icon: fas fa-bookmark
id: bookmarks