Attribute definitions in antora.yml are global to the component containing antora.yml. There is no way to target those attributes to a specific module. But they are easily overridden within the page that uses them.
For example, if you define an attribute in antora.yml:
asciidoc:
attributes:
foo: bar
Then wherever you use {foo} in your component's pages, you'd see bar in the generated HTML.
To override that in a specific page:
:foo: FOO
When the {foo} attribute is encountered anywhere on the same page, after that definition, you'd see FOO in the generated HTML.
If you have multiple pages in a module that need to share the same definition, you can place those definitions into a separate Asciidoc file, say attributes.adoc. If you place that file into the module's partials folder, you can include it on any module page that requires the attribute definitions with:
include::partial$attributes.adoc[]
You don't have to define all attributes within attributes.adoc, only the ones that need to be redefined for the module.
Attribute definitions in
antora.yml
are global to the component containingantora.yml
. There is no way to target those attributes to a specific module. But they are easily overridden within the page that uses them.For example, if you define an attribute in
antora.yml
:Then wherever you use
{foo}
in your component's pages, you'd seebar
in the generated HTML.To override that in a specific page:
When the
{foo}
attribute is encountered anywhere on the same page, after that definition, you'd seeFOO
in the generated HTML.If you have multiple pages in a module that need to share the same definition, you can place those definitions into a separate Asciidoc file, say
attributes.adoc
. If you place that file into the module'spartials
folder, you can include it on any module page that requires the attribute definitions with:You don't have to define all attributes within
attributes.adoc
, only the ones that need to be redefined for the module.