Not detecting broken xrefs in navigation files
Using Antora 2.3.4 and @antora/xref-validator@1.0.0-alpha.12
I ran the following commands because I've renamed the redirect facility file from configure-redirect-facility.adoc
to urls-redirect-facility.adoc
(to keep it inline with the other playbook key pages now that we're adding more urls
keys).
NODE_PATH="$(npm -g root)" antora --generator @antora/xref-validator --attribute page-aliases=~ local-antora-playbook.yml
Unresolved xrefs (grouped by origin):
worktree: /home/apex/projects/antora/antora/docs | component: antora | version: 3.0
path: modules/cli/pages/index.adoc | xref: playbook:configure-redirect-facility.adoc
path: modules/playbook/pages/configure-urls.adoc | xref: urls-html-extension-style.adoc
antora: xref validation failed! Found 2 unresolved xrefs. See previous report for details.
Notice that it found one xref I wanted to correct because it was using the alias, and another broken xref for a page I hadn't added yet.
What it didn't catch was the xref using the alias in the nav file: /home/apex/projects/antora/antora/docs/modules/playbook/nav.adoc
.
I corrected the two xrefs listed in the first report and ran the command again, once with the attribute flag and once without, to confirm it was missing the xref in the nav file. Nothing was reported.
apex@stealth docs.antora.org⎇ master $ NODE_PATH="$(npm -g root)" antora --generator @antora/xref-validator --attribute page-aliases=~ local-antora-playbook.yml
apex@stealth docs.antora.org⎇ master $ NODE_PATH="$(npm -g root)" antora --generator @antora/xref-validator local-antora-playbook.yml
Then, just to be super-duper sure, I purposely enter an invalid xref target in the nav.adoc file * xref:redirect-facility-kaboom.adoc[]
. And fetched and cleaned.
apex@stealth docs.antora.org⎇ master $ antora --fetch --clean local-antora-playbook.yml
[fetch] https://gitlab.com/antora/antora.git [######################################################]
[fetch] https://gitlab.com/antora/antora-ui-default.git [######################################################]
apex@stealth docs.antora.org⎇ master $ NODE_PATH="$(npm -g root)" antora --generator @antora/xref-validator local-antora-playbook.yml
apex@stealth docs.antora.org⎇ master $
But, as you can see, the link is clearly broken.