Define a Component with No Version

Sometimes the project or process you’re documenting isn’t versioned. For example, hosted technology services and team handbooks may only need their content to represent how the service or process works as of right now. This is where the reserved version value of a tilde, ~, comes into play.

Assign ~ to the version key

To define a component version that doesn’t have a version, assign a tilde, ~, to the version key. The ~ is shorthand for the value null, which has the same effect.

Example 1. antora.yml for a versionless component version
name: component-name
version: ~ (1)
1 On a new line, type the key version, directly followed by a colon and a blank space (: ). Then enter the value ~.

Antora doesn’t apply the same behavior and output rules to an versionless component version that it does to a component version with a named or semantic version. For example, Antora doesn’t include the version segment in the publishable resource URLs of an versionless component version (e.g., /component-name/module-name/page-name.html).

Behavior and output

The version key is required for a component version since versioning is central to how Antora works. The behavior and output rules that are influenced by the version are described in How Antora uses version. However, Antora accounts for the fact that some components are versionless or have an empty component version co-located with non-empty component versions. When the version key is assigned ~, defining the component version as versionless, Antora:

UI and extension developers

When a component version is defined as versionless:

  • the reserved version value, ~ or null, is coerced into and stored as an empty string internally

  • a version segment isn’t added to pub.url or out.path

Reference a versionless resource

Because a versionless component version is typically the only version (or, at least, the latest component version) in a component, Antora automatically routes any incoming references that originate from other components that don’t specify a version coordinate to it. However, in rare cases, such as when referencing a versionless prerelease from another component version, you can use the reserved keyword _ (an underscore) as the version coordinate in the resource ID (e.g., xref:_@component:module:file.adoc[]) to reference a versionless component version.