Antora Cross-Reference Maintenance
1. Overview
This runbook documents the cross-reference (xref) rules for the domus-* documentation ecosystem and provides procedures for auditing, fixing, and verifying xref compliance.
|
The Golden Rule: Cross-component xrefs (`xref:component::path.adoc[`]) only work when building through the hub (domus-docs). Spoke repos building standalone will FAIL. |
3. The Rules
3.1. Rule 1: No Cross-Component Xrefs in Spokes
| Location | Allowed Xrefs |
|---|---|
Hub (domus-docs) |
`xref:component::path.adoc[Label`] ✓ |
Spoke (all other domus-*) |
Same-component only: `xref:path.adoc[Label`] ✓ |
4. Audit Procedure
4.1. Step 1: Scan All Repos
# Run from atelier/_bibliotheca/
for repo in domus-automation-ops domus-captures domus-identity-ops domus-infra-ops \
domus-ise-linux domus-ise-ops domus-ise-windows domus-linux-ops \
domus-netapi-docs domus-o11y-ops domus-python domus-secrets-ops \
domus-siem-ops domus-windows-ops; do
REPO_PATH="/home/evanusmodestus/atelier/_bibliotheca/$repo"
count=$(grep -rn 'xref:[a-z-]*::' "$REPO_PATH/docs" 2>/dev/null \
| grep -v '/build/' \
| grep -v '/_drafts/' \
| grep -v 'template.adoc' \
| grep -v 'antora-xref-guide' \
| grep -v 'antora-architecture' \
| grep -v 'antora-troubleshooting' \
| grep -v 'docs-as-code' \
| wc -l)
if [ "$count" -gt 0 ]; then
echo "$repo: $count potential violations"
fi
done
5. Fix Procedure
5.1. Single File Fix
# Preview what will change
sed -n 's|xref:infra-ops::runbooks/backup-strategy.adoc\[Backup Strategy\]|Backup Strategy (infra-ops)|gp' file.adoc
# Apply fix
sed -i 's|xref:infra-ops::runbooks/backup-strategy.adoc\[Backup Strategy\]|Backup Strategy (infra-ops)|g' file.adoc
5.2. Batch Fix Pattern
# Fix all .adoc files in a directory
find /path/to/repo/docs -name "*.adoc" -type f -exec sed -i \
-e 's|xref:infra-ops::index.adoc\[Infrastructure Ops\]|Infrastructure Ops (infra-ops)|g' \
-e 's|xref:ise-linux::index.adoc\[ISE Linux\]|ISE Linux (ise-linux)|g' \
-e 's|xref:linux-ops::index.adoc\[Linux Operations\]|Linux Operations (linux-ops)|g' \
{} \;
5.3. Common Replacements
| Original | Replacement |
|---|---|
`xref:infra-ops::index.adoc[Infrastructure Ops]` |
|
`xref:ise-linux::index.adoc[ISE Linux]` |
|
`xref:linux-ops::index.adoc[Linux Operations]` |
|
`xref:netapi::index.adoc[netapi CLI]` |
|
`xref:identity-ops::index.adoc[Identity Ops]` |
|
`xref:secrets-ops::index.adoc[Secrets Ops]` |
|
6. Commit and Push
7. Verify Build
7.1. Local Build (Hub)
cd /home/evanusmodestus/atelier/_bibliotheca/domus-docs
make
Watch for:
[ERROR] target of xref not found: component::path.adoc
7.2. Check Deployments
# List recent Cloudflare Pages deployments
CLOUDFLARE_ACCOUNT_ID=7f6981e005108a7a90b03ec3ff4b5197 \
wrangler pages deployment list --project-name=domus-docs
Expected output shows: - Environment: Production - Branch: main - Source: commit hash matching your push - Status: timestamp showing recent deployment
8. Changelog
When fixing xrefs across repos, document in changelog:
= YYYY-MM-DD - Cross-Component Xref Fixes
== Summary
Fixed N cross-component xref violations across M spoke repos.
== Repos Fixed
* domus-automation-ops: N violations
* domus-ise-ops: N violations
...
== Pattern Applied
Converted `xref:component::path.adoc[Label]` to `Label (component)`
9. Quick Reference
| Task | Command |
|---|---|
Scan all repos |
|
Fix single xref |
|
Commit fix |
|
Check deployments |
|
Local build |
|
10. Troubleshooting
11. Related
-
2026-02-21 Backup Docs Overhaul - Example of xref fix session