Attachments Directory and Attachment Files

Attachments family directory

A module directory can contain an optional family directory named attachments.

📂 modules
  📂 ROOT
    📂 attachments (1)
      📄 a-source-file.zip (2)
    📂 pages
      📄 a-source-file.adoc
    📄 nav.adoc
1 An attachments family directory in a ROOT module directory
2 An attachment source file

Antora applies preset behavior to the source files stored in an attachments directory when it generates a site.

Attachments

An attachment is a resource, such as the ZIP archive of a sample project, that a site visitor can download via a link. The source files for attachments are stored in an attachments directory. A link to an attachment is created in a page or partial using the AsciiDoc link macro. Currently, you can’t reference an attachment using an Antora resource ID.

Binaries and other large files

If your content includes large attachment files, such as sample project binaries, libraries, or PDFs, we don’t recommend storing them in a regular git repository. Instead, host them in a binary repository such as Bintray or S3, or use git LFS (Large File Storage).

Assets

A module directory can also contain a directory named assets. This is an alternate location, recognized by Antora, where the attachments and images family directories can be placed.

📒 repository
  📄 antora.yml
  📂 modules
    📂 ROOT
      📂 assets
        📂 attachments
          📄 a-source-file.zip
        📂 images
          📄 a-source-file.png
      📂 pages
        📄 a-source-file.adoc
      📄 nav.adoc

You don’t need to set the path to these predefined directories in the header of your pages. This is managed automatically by Antora.