Assign UI Templates with page-layout
Antora provides a page attribute named page-layout
.
This attribute applies an alternate UI layout to the contents of a page.
page-layout attribute
The page-layout
attribute is optional.
It’s defined in the header of a page using an AsciiDoc attribute entry.
= Page Title
:page-layout: tiles
The page-layout
attribute accepts the filename of a UI layout file without the file extension.
For example, if you want a page to use the layout file tiles.hbs, assign the value tiles
to page-layout
.
The associated layout file (e.g., tiles.hbs) is expected to be located in the UI bundle’s layouts directory.
When the page-layout
attribute is explicitly set in the header of a page, it overrides the default layout.
Default page-layout
If page-layout
isn’t defined in a page’s header, then the page layout defined by the default_layout playbook key is applied when the site is generated.
When neither page-layout
or default_layout
are set, Antora automatically assigns the built-in default
value to default_layout
.
The default
page layout applies the default.hbs layout file to any pages where page-layout
isn’t explicitly set.