Antora Folder Structure

The content folders follow a standard directory structure which are used to store the documentation component’s source files. Documentation component represents the page documentation consists of a collection of files grouped into modules and share common metadata. There can be more than one documentation component for the site. Also, it follows a specific organization of files and directories which allow them to preset styles and behavior automatically.

Directory
|_ Docs
  |_ modules/ROOT
    |_ images
    |_ pages
      |_index.adoc
   |_nav.adoc
  |_ Modules/DevOps
    |_assect/images
    |_pages
      |_ abc.adoc
      |_ file.adoc
    |_ nav.adoc
  |_ antora.yml
  • Each folder contains atleast, component descriptor file(antora.yml), one module directory(ROOT), images directory, partials directory, Navigation file.

antora.yml

Antora extracts the metadata defined in the file antora.yml and applies it to the documentation component. The following attributes need to be specified for the particular component in antora.yml file.

Attributes Value

name

Component Name

title

Component Title

version

Version

display_version

Display version in the page

nav

path to nav.adoc file

The attributes name, title, version, display_version are straightforward and Refer for information about nav.adoc file.

Modules directory

The modules directory consists of a discrete bundle of text, images, reusable components. You can have as many modules for the component depending on the documentation requirements. Inside each module, you can create folders like images, partials, pages, nav.adoc for the particular module. It’s recommended to create a ROOT module directory and Antora automatically applies component-level URLs to the page files in the ROOT module. This means that the pages in the ROOT module are promoted a level above other modules on the component’s URL. The images directory consists of the image files for the particular modules and pages contain the documentation written in AsciiDoc format.

Images directory

AsciiDoc supports png, jpg, svg, and gif files.

Example 1

assets/images
|_ image-file.jpg

Example 2

assets/images
|_new-folder
  |_ image-file.svg

Pages directory

The documentation files are stored in the page directory. These files are converted by HTML and publishes as individual pages in the generated site.
Example 1

page
|_ page-name.adoc
You can create as many folders as you want under pages directory if you have more pages for the particular module..

nav.adoc

This file contains the navigation routes for the particular module. It contains the reference links to pages in the modules and an example can be found below point_down.

* xref:index.adoc[Introduction]
** xref:antora.adoc[Getting Started]
** xref:Installation.adoc[Installation]
** subfolder
*** xref:setup-antora.adoc[Setup Antora]
A new page created must be registered in the nav.adoc file to display in the website.