I want to use the same key attribute in different module, but the value is different.
I defined attribute in antora.yml , but it seems no way to distinguish modules.
What should I do?
I want to use the same key attribute in different module, but the value is different.
I defined attribute in antora.yml , but it seems no way to distinguish modules.
What should I do?
Copyright © 2021 Jogjafile Inc.
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.