fix(generator): 修复自定义页面配置不生效问题

- src/generator.js:
    - 修改 `generateHTML` 和 `processTemplate` 函数,根据 `navigation` 配置动态生成所有页面 HTML,不再硬编码特定页面。
    - 修改 `generateNavigation` 函数,添加通用子菜单处理逻辑,支持为任意包含 `categories` 的页面生成子菜单。
- templates/index.html:
    - 移除硬编码的页面 `div` 结构。
    - 使用 `{{ALL_PAGES}}` 占位符动态注入所有页面内容。
- README.md:
    - 更新文档配置说明

Closes #6
This commit is contained in:
Zuoling Rong
2025-05-04 20:23:23 +08:00
parent dc8f97439e
commit 297890315b
4 changed files with 312 additions and 157 deletions

20
.gitignore vendored
View File

@@ -25,4 +25,22 @@ test-bookmarks.ps1
test-bookmarks.sh
# 个人笔记
note.md
docs/*
# 自定义配置文件
config/user/*
config.user.yml
bookmarks.user.yml
# 测试相关文件
jest.config.js
tests/
coverage/
.nyc_output/
jest-*.json
jest.results.json
.eslintcache
tests/screenshots/
tests/fixtures/
*.test.js
*.spec.js