内容键
在content和sources下配置的playbook键定义了内容源存储库的位置以及它们的处理方式。
内容键
content类别键封装了Antora站点中内容源(即git存储库)的列表。内容源使用sources键进行定义。可以使用branches、tags和edit_url键来定义所有内容源的默认值。这些键可以在每个内容源中重新定义,以及其他特定于内容源的键。
content: (1)
branches: [v2.0, v2.5, v3.0] (2)
tags: [release/*, '!release/*-patch'] (3)
edit_url: '{web_url}/blob/{refname}/{path}' (4)
sources: (5)
- url: https://git-service.com/org/repo-z.git (6)
start_path: path-to/content-source-root (7)
- url: https://git-service.com/org/repo-y.git (8)
| 1 | 必需的content键 |
| 2 | 可选的branches键 |
| 3 | 可选的tags键 |
| 4 | 可选的edit_url键 |
| 5 | 必需的sources键 |
| 6 | 必需的url键 |
| 7 | 可选的start_path键 |
| 8 | 另一个url键 |
content和sources键是必需的。 sources键必须至少包含一个定义了url键的条目。所有其他键都是可选的。如果在playbook中未明确设置,branches和edit_url键具有内置值,Antora在运行时会自动应用这些值。
直接在content下指定的键值对将应用于sources下的所有url键条目,除非该键也在特定的url上指定。
源键
sources键是必需的,并嵌套在content键下。 sources键包含源条目的列表。 每个条目由一个连字符指定,包括git存储库位置(URL或文件系统路径)、匹配分支和/或标签的模式、可选的起始路径或路径,以及Antora在聚合站点内容时使用的其他存储库属性。
content: (1)
sources: (2)
- url: https://git-service.com/org/repo-z.git (3)
branches: [v1.*, v2.*, !v1.2] (4)
start_paths: path-to/content-source-root-{item..item} (5)
- url: https://git-service.com/org/repo-y.git (6)
branches: [] (7)
tags: [release/*, '!release/*-patch'] (8)
start_path: path-to/content-source-root (9)
edit_url: '{web_url}/blob/{refname}/{path}' (10)
- url: https://git-service.com/org/repo-x.git (11)
branches: v* (12)
version: true (13)
| 1 | 必需的content键 |
| 2 | 必需的sources键 |
| 3 | 必需的url键 |
| 4 | 可选的branches键 |
| 5 | 可选的start_paths键 |
| 6 | 另一个url键 |
| 7 | 可选的branches键 |
| 8 | 可选的tags键 |
| 9 | 可选的start_path键 |
| 10 | 可选的edit_url键 |
| 11 | 另一个url键 |
| 12 | 可选的branches键 |
| 13 | 可选的version键 |
| 如果未匹配到内容源条目的git引用(分支或标签),Antora将以信息级别记录消息。您必须将日志严重级别设置为至少info才能看到此消息。我们建议相应地配置Antora的记录器以帮助调试。 |
version键为组件版本描述符(antora.yml)中的version键提供了一个回退值。只有在匹配单个引用或希望该值从refname派生时才应使用它。
可用的内容源键
| 内容键 | 描述 | 必需 |
|---|---|---|
|
接受一个精确的分支名称和名称模式列表,以从内容源中指定的存储库中使用。如果未指定,默认为 |
否 |
|
|
接受用于构建映射到当前页面源视图的URL模式。支持以下占位符段: |
否 |
|
|
指定存储库中内容源根位置的相对路径。 |
否 |
|
|
接受存储库相对路径模式列表,指向内容源根位置,可以是精确路径或shell glob模式。单个值被强制转换为数组。 |
否 |
|
|
接受一个精确的标签名称和名称模式列表,以从内容源中指定的存储库中使用。 |
否 |
|
|
接受git存储库的URL,可以是HTTPS URL或本地文件系统路径。 |
是 |
|
|
为所有匹配引用提供 |
否 |
|
|
接受关键字或精确的分支名称或名称模式列表,以控制Antora应使用哪些对应的工作树。 |
否 |