| | |
| | | 扫描范围(用户指定) |
| | | -------------------- |
| | | - 顶层黑名单 EXCLUDE_TOP 整棵子树不扫:X2.Archived / 00index / X1.Knomo / X.Attachment / P3.bobo |
| | | - 嵌套黑名单 EXCLUDE_PATHS 整棵子树不扫:02DS/02copilot(Copilot 对话日志)、 |
| | | 02DS/01dril-book(读书笔记库);两者均「永不从其中取内容生成 tagfeed」。 |
| | | - 仅扫描后缀 SCAN_EXT:.md .markdown .excalidraw .canvas;其它后缀一律跳过 |
| | | - markdown 只抽标准 `tags:` frontmatter 与正文 #tag;topic/category/type 等 |
| | | 元数据字段不再当作标签(避免 copilot 对话、读书笔记的元数据被误建页) |
| | | - markdown 只抽标准 `tags:` frontmatter 与正文 #tag;topic/category/keywords/type 等 |
| | | 元数据字段绝不当作标签(避免 copilot 对话、读书笔记的元数据被误建页) |
| | | |
| | | 幂等 & 安全 |
| | | ---------- |
| | |
| | | SCAN_EXT = {".md", ".markdown", ".excalidraw", ".canvas"} |
| | | EXCLUDE_TOP = {"X2.Archived", "00index", "X1.Knomo", "X.Attachment", "P3.bobo"} |
| | | # 嵌套路径排除(只排除指定子树,不影响其同级目录)。 |
| | | # 例:02DS/02copilot 是 Obsidian Copilot 的对话日志,其 topic: 字段与聊天正文 |
| | | # 不应被当作标签扫描(与 tagfeed 模板的 excludedPaths 保持一致)。 |
| | | EXCLUDE_PATHS = {"02DS/02copilot"} |
| | | # 02DS/02copilot:Obsidian Copilot 对话日志,topic: 字段与聊天正文不应被当作标签扫描。 |
| | | # 02DS/01dril-book:读书笔记库,其正文/元数据亦不希望进入 tagfeed 体系。 |
| | | # 两者「永不从其中取内容」(与 tagfeed 模板的 excludedPaths 保持一致)。 |
| | | EXCLUDE_PATHS = {"02DS/02copilot", "02DS/01dril-book"} |
| | | INBOX_DIR = "0inbox" |
| | | EXCLUDE_DIRS = {".obsidian", ".trash", ".git", ".agents", ".claude", |
| | | ".copilot", ".opencode", ".smart-env", ".workbuddy"} |
| | |
| | | tok = tok.strip().lstrip("#") |
| | | if tok: |
| | | tags.add(tok) |
| | | for val in fm.values(): |
| | | for tok in split_fm_value(val): |
| | | mm = TAG_RE.search(str(tok)) |
| | | if mm: |
| | | tags.add(mm.group(1)) |
| | | # 注意:不再遍历所有 frontmatter 值去抽取 #tag。 |
| | | # 否则 topic/category/keywords 等元数据字段里出现的 # 文本 |
| | | # 会被误判为标签,违背「这类字段不生成 tagfeed 页」的约定。 |
| | | in_fence = False |
| | | for line in body.splitlines(): |
| | | if line.lstrip().startswith("```"): |
| | |
| | | "> 本页由 DataviewJS 实时计算,笔记有变动时自动刷新。\n\n" |
| | | "```dataviewjs\n" |
| | | "const targetTag = \"__TARGET_TAG__\";\n" |
| | | "const excludedPaths = [\"X2.Archived\", \"X0.Clippings\", \"X1.Knomo\", \"02DS/02copilot\", \".agents\", \".claude\", \".copilot\", \".opencode\", \".smart-env\", \".workbuddy\", \".trash\"];\n" |
| | | "const excludedPaths = [\"X2.Archived\", \"X0.Clippings\", \"X1.Knomo\", \"02DS/02copilot\", \"02DS/01dril-book\", \".agents\", \".claude\", \".copilot\", \".opencode\", \".smart-env\", \".workbuddy\", \".trash\"];\n" |
| | | "dv.paragraph(\"#\" + targetTag + \" 聚合占位\");\n" |
| | | "```\n" |
| | | ) |