| | |
| | | HasMergeHint: hasMerge, |
| | | } |
| | | |
| | | // 从路径提取一级目录名作为 Type |
| | | // 路径格式:待审阅/TAPD提取/003-xxx/draft.md |
| | | parts := strings.Split(relPath, string(filepath.Separator)) |
| | | if len(parts) >= 2 && parts[0] == "待审阅" { |
| | | draft.Type = parts[1] |
| | | } |
| | | |
| | | // 解析 frontmatter |
| | | fm := parseFrontmatter(string(content)) |
| | | if title, ok := fm["title"]; ok { |
| | |
| | | if status, ok := fm["status"]; ok { |
| | | draft.Status = status |
| | | } |
| | | if draftType, ok := fm["type"]; ok { |
| | | draft.Type = draftType |
| | | } |
| | | if created, ok := fm["created"]; ok { |
| | | draft.Created = created |
| | | } |
| | |
| | | HasMergeHint: false, |
| | | } |
| | | |
| | | // 从路径提取一级目录名作为 Type |
| | | // 路径格式:待审阅/TAPD提取/003-xxx.md |
| | | parts := strings.Split(relPath, string(filepath.Separator)) |
| | | if len(parts) >= 2 && parts[0] == "待审阅" { |
| | | draft.Type = parts[1] |
| | | } |
| | | |
| | | // 解析 frontmatter |
| | | fm := parseFrontmatter(string(content)) |
| | | if title, ok := fm["title"]; ok { |
| | |
| | | if status, ok := fm["status"]; ok { |
| | | draft.Status = status |
| | | } |
| | | if draftType, ok := fm["type"]; ok { |
| | | draft.Type = draftType |
| | | } |
| | | if created, ok := fm["created"]; ok { |
| | | draft.Created = created |
| | | } |