Using Antora Attributes
This guide explains how to use global Antora attributes in the FoodTruckNerds documentation to maintain consistent references to repositories, URLs, and organization information.
What Are Antora Attributes?
Antora attributes are variables defined in the playbook that can be referenced throughout your documentation. They provide a single source of truth for commonly used values like repository URLs, organization names, and site URLs.
Available Global Attributes
The following attributes are defined in both antora-playbook.yml and antora-playbook-local.yml:
Organization Attributes
| Attribute | Value | Usage |
|---|---|---|
|
|
Organization name only |
|
Full organization URL |
|
|
Documentation site URL |
Repository Name Attributes
| Attribute | Value | Purpose |
|---|---|---|
|
|
Main documentation repository |
|
|
Main Next.js web application |
|
|
Food Truck API repository |
|
|
Developer onboarding repository |
|
|
Help documentation repository |
|
|
Developer portal repository |
|
|
Legacy website repository |
How to Use Attributes
In Links
Simple Link
Visit the {github-org-url}[FoodTruckNerds organization] on GitHub.
Renders as: Visit the FoodTruckNerds organization on GitHub.
Repository Link
Clone from {github-org-url}/{repo-ftn-site}[ftn-site repository].
Renders as: Clone from ftn-site repository.
Documentation Site Link
See the {docs-site-url}[documentation site] for more information.
Renders as: See the documentation site for more information.
Common Patterns
Repository References
When mentioning a repository:
For setup instructions, see the {github-org-url}/{repo-onboarding}[onboarding repository].
Best Practices
DO: Use Attributes for Repository References
✅ Good:
Clone from {github-org-url}/{repo-ftn-site}.git
❌ Avoid:
Clone from https://github.com/FoodTruckNerds/ftn-site.git
DO: Use Attributes for Organization URLs
✅ Good:
Visit {github-org-url} to see all repositories.
❌ Avoid:
Visit https://github.com/FoodTruckNerds to see all repositories.
DO: Use Attributes for Documentation Site URLs
✅ Good:
See {docs-site-url}/docs/troubleshooting.html
❌ Avoid:
See https://docs.foodtrucknerdz.com/docs/troubleshooting.html
DON’T: Use Attributes in Example Error Messages
When showing example error output, use literal values for clarity:
✅ Good (example error message):
[source]
FATAL: the start path 'docs' does not exist in https://github.com/FoodTruckNerds/ftn-site.git
This helps readers recognize the error pattern.
Adding New Attributes
If you need to add a new global attribute:
-
Open both playbook files:
-
site/antora-playbook.yml -
site/antora-playbook-local.yml
-
-
Add the attribute under
asciidoc.attributes:asciidoc: attributes: # Existing attributes... new-attribute-name: value -
Use the attribute in documentation:
{new-attribute-name} -
Commit both playbook files together to keep them in sync
|
Always update both playbooks: Changes to attributes must be made in both |
Troubleshooting
Attribute Not Resolving
If an attribute shows as {attribute-name} instead of its value:
-
Check spelling: Attribute names are case-sensitive
-
Verify definition: Ensure the attribute is defined in the playbook
-
Rebuild: Run
pnpm exec antoraagain to pick up changes -
Check scope: Attributes defined in the playbook are available globally
Examples from Our Documentation
Example 1: Repository Link in README
From ftn-site/docs/README.adoc:
This documentation is aggregated into the unified FoodTruckNerds
documentation site via the playbook in the
{github-org-url}/{repo-docs}[docs repository].
Published site: {docs-site-url}
Related Documentation
-
Building the Antora Documentation Site Locally — Building the documentation site locally
-
Setting Up GitHub Actions for Antora with Private Repositories — CI/CD setup with GitHub Actions