Archive Provider
In order to publish a site’s files as a ZIP archive, your playbook must set the output, destinations and provider keys.
archive provider
The provider value archive publishes a site to a ZIP file.
output:
destinations: (1)
- provider: archive (2)
| 1 | The provider key must be configured under the destinations key. |
| 2 | Under destinations, type a hyphen (-) and a blank space, then the key name provider, followed by a colon (:).
After the colon, enter a blank space, and then the built-in value name archive. |
Unless the path key is specified, the default output target for the archive provider is build/site.zip.
path key
The optional path key designates the target path and filename of the generated ZIP archive.
If path isn’t specified, Antora uses the default archive path value, build/site.zip.
The path key accepts a relative or absolute filesystem path.
The provider will create any interim directories as needed.
A relative path is expanded to an absolute path using the following rules:
-
If the first path segment is a tilde (
~), the remaining path is resolved relative to the user’s home directory. -
If the first path segment is a dot (
.), the remaining path is resolved relative to the location of the playbook file. -
If the first path segment is a tilde directly followed by a plus sign (
~+), or does not begin with an aforementioned prefix, the remaining path is resolved relative to the current working directory.
Specify a relative path
In Example 2, the site will be published to the target file blue.zip relative to the playbook file.
output:
destinations:
- provider: archive
path: ./blue.zip
Specify an absolute path
In Example 3, the site will be published to /home/user/projects/launch/blue.zip, regardless of where the playbook is located.
output:
destinations:
- provider: archive
path: /home/user/projects/launch/blue.zip
Publish to multiple destinations
In Example 4, Antora is running on a playbook file in the tmp directory and publishing the site to two locations, one relative and one absolute.
output:
destinations:
- provider: fs
path: ./releases/red
clean: true
- provider: archive
path: /home/user/projects/docs-site/blue.zip
The site files published using the fs are written to the directory tmp/releases/red.
This directory will be removed prior to publishing since the clean key is assigned true.
The site is also published as an archive to /home/user/projects/docs-site/blue.zip by the archive provider.