跳到主要內容

arc collections

arc collections 是 blocklet.yaml 裡 collections: 宣告的編寫工具——目前能做的是掃描 content/ 幫你生成這段片段。

arc collections 是一個小的編寫工具組,服務於 blocklet 的 blocklet.yamlcollections: 這一段宣告——就是告訴執行時哪些 content/ 子樹是可索引的集合,以及它們暴露哪些 face(web、sitemap、llms)。目前只有一個子命令。

bash
arc collections <subcommand> [options]

全域選項(見 總覽):--json--view--instance / -i(作用在哪個本地 ARC 例項;省略即 default),以及 --home(例項根;要指定作用在哪個例項,用 --instance)。

arc collections scan

掃描一個站點的 content/ 目錄,生成一段可以直接貼進 blocklet.yamlcollections: YAML 片段,不用手寫這段宣告。

用法

bash
arc collections scan [dir] [options]
  • [dir](可選,預設 .):站點根目錄——包含 content/ 的那個目錄

示例(在一個有 content/ 樹的站點根目錄下跑;下面只展示生成的兩個 collection,其餘的形狀一樣)

bash
$ arc collections scan .
# Paste into blocklet.yaml. mcp is intentionally omitted — opt-in only (epic #3657 W2).
collections:
  articles:
    type: local:articles
    indexable:
      - "content/articles/**/content.md"
    faces:
      web: true
      sitemap: true
      llms: [index, full]
  docs:
    type: local:docs
    indexable:
      - "content/docs/**/content.md"
    faces:
      web: true
      sitemap: true
      llms: [index, full]
  ...

把列印出來的片段貼進目標 blocklet.yamlcollections: 鍵下;arc collections scan 只列印,不會幫你寫檔案。