Module Segment in Page URLs

URLs for ROOT module pages

When a ROOT module’s pages are published to a site, they become the top-level pages of their assigned component version. That means the module name, ROOT, never appears in the page’s URL.

To demonstrate this concept, let’s compare the URLs of two pages, one assigned to a ROOT module and one assigned to a named module. The set of standard directories illustrated in Example 1 contains content source files for a project named Hyper Lemur.

Example 1. Two module directories containing content that’s part of the Hyper Lemur project
📒 repository
  📄 antora.yml
  📂 modules
    📂 admin
      📂 pages
        📄 user-management.adoc
      📄 nav.adoc
    📂 ROOT
      📂 images
      📂 pages
        📄 deploy.adoc
        📄 index.adoc
      📄 nav.adoc

Notice the file named deploy.adoc in the pages folder inside the ROOT module folder. When Antora generates a site for Hyper Lemur, the URL for the page created from the deploy.adoc source file will look like this.

ROOT module page URL

The base URL, https://my-company.com, is set in the playbook that Antora used to generate the site. The component name segment, hyperlemur, and version segment, 1.0, are set in the component version descriptor. The page segment, deploy, is the family-relative path of the AsciiDoc source file deploy.adoc. The name of the module, ROOT, isn’t used in the URL.

Now, let’s see what the URL of a page stored in the named module, admin, would look like.

URLs for named module pages

Using the Hyper Lemur source files in Example 1, let’s see what the URL for the user-management.adoc file would look like. The file is assigned to the pages family of the admin module.

Named module page URL

Notice that the name of the module, admin, is in the URL directly after the component’s version.