Page Xrefs and Link Text in Navigation Files :: Antora Docs (original) (raw)
Cross references to pages in a navigation list are constructed using the AsciiDoc xref macro and the resource ID of a page.
The xrefs in a navigation file’s list most often target pages that belong to the same module as the navigation file. In these cases, the resource IDs don’t require the version, component, or module coordinates. However, regardless of what component version a navigation file belongs to, you can still link to any page in the site from any navigation list, whether they belong to a different modules or components.
Example 1. nav.adoc
* xref:filename.adoc[Optional link text] (1)
* xref:module:filename.adoc[] (2)
* xref:version@component:module:filename.adoc[] (3)
1 | Xref targeting a page in the same module. The xref also specifies link text. |
---|---|
2 | Page in the same component version, but a different module. |
3 | Page in another docs component. |
Xrefs in navigation files can use the target page’s default navigation link text or have link text specified inside the macro’s square brackets ([]
). The link text is displayed in the component version’s page menu. When a visitor clicks on the link text, they’re routed to the target page specified by the resource ID in the xref. The link text, regardless of whether it’s the default link text or specified in the xref, is also displayed in the breadcrumbs at the top of the target page.