Files
git-learn/openspec/changes/knowledge-index-panel/tasks.md
T

27 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 1. bash 索引生成脚本
- [x] 1.1 创建 `scripts/update-knowledge-index.sh`,实现 `knowledge/entries/knowledge_*/` 自动扫描,并兼容根目录 `knowledge_*/`
- [x] 1.2 实现从目录名提取 date(YYYYMMDD)和 slug
- [x] 1.3 实现从 .md 文件提取 YAML frontmatter(title、tags、author)和正文
- [x] 1.4 实现降级逻辑:YAML 解析失败时用 slug 作 title,空 tags 处理
- [x] 1.5 将提取的数据生成为 JS 数组字面量,包含条目相对路径,并注入 HTML 模板
## 2. HTML 模板和样式
- [x] 2.1 创建 HTML 模板结构(header、搜索栏、条目卡片区、标签云区、footer、`__DATA_PLACEHOLDER__` 占位符)
- [x] 2.2 编写 CSS 样式(响应式、卡片设计、搜索高亮 `<mark>`、标签徽章、中文优化字体)
## 3. 前端 JS 交互逻辑
- [x] 3.1 实现实时搜索过滤(匹配 title、tags、body,大小写不敏感)
- [x] 3.2 实现搜索高亮和"无结果"提示
- [x] 3.3 实现标签云渲染和点击过滤(选中高亮、再点取消)
- [x] 3.4 实现"相关内容"推荐(基于共享标签的条目间关联)
- [x] 3.5 实现条目标题链接,指向 `knowledge/entries/<entry>/<entry>.html`
## 4. 集成和测试
- [x] 4.1 用现有 2 个 knowledge 条目运行脚本,生成 knowledge-index.html
- [x] 4.2 测试边界情况:空 tags、YAML 最小 frontmatter、缺失目录
- [x] 4.3 在浏览器中验证搜索、标签过滤、相关推荐功能