站点开始页面
当您将页面的有效资源 ID 分配给 playbook 的 start_page
键时,站点访问者将从站点 URL 的索引页面重定向到起始页面的 URL 。
start_page键
start_page
键是可选的。它在剧本的 site
键下配置。
Example 1. Example 1. antora-playbook.yml
site:
title: Site Title
url: https://example.org
start_page: component:module:file-coordinate-of-page.adoc
您可以使用任何属于组件版本的页面作为站点的索引页面。 start_page
键接受页面的资源 ID 作为值。资源 ID 必须包括组件、模块和文件坐标。如果您想要使用页面的特定版本而不是最新版本,则可以指定版本坐标。另外,start_page
也可以通过 CLI 进行分配。
使用页面最新版本
如果要始终将 start_page
键指向指定页面的最新版本,则不要在页面的资源 ID 中输入版本坐标。
Example 2. Example 2. antora-playbook.yml
site:
title: Demo Docs Site
url: https://demo.antora.org
start_page: component-b::index.adoc
举个例子,假设版本 2.0 是组件 B 的最新版本。在这种情况下,https://demo.antora.org/index.html
将重定向到 https://demo.antora.org/component-b/2.0/index.html
。
使用页面指定的版本
如果您希望站点的起始页面是指定页面的特定版本,则在资源 ID 中包括版本坐标。
Example 3. Example 3. antora-playbook.yml
site:
title: Demo Docs Site
url: https://demo.antora.org
start_page: 1.0@component-b::index.adoc
- NOTE
-
要配置组件版本的起始页,请参见 选择起始页。