antora-confluence icon indicating copy to clipboard operation
antora-confluence copied to clipboard

Publication failing when a page title (link) is broken

Open TitouanM opened this issue 1 year ago • 2 comments

Hello

I'm using tis plugin on a big Antora project. Some links seems to be broken or pointing on a page that doesn't exist.

Actually, the confluence publication fails and stops at the first broken link.

Would it be possible to add an option to ignore those broken links please ?

Best regards

TitouanM avatar Jul 02 '24 09:07 TitouanM

So you want an option to allow the export of pages with broken links?

Could you provide me the error logs and an example that causes the error? I could investigate and fix the issue probably.

PacoVK avatar Jul 03 '24 18:07 PacoVK

I have some examples that cause the issue :

  • image:image_name.JPG[link={imagesdir}/image_name.JPG] => Here, the images are located in ROOT/assets/images. The correct path that resolve the problem is image:image_name.JPG[]
  • image:../image_name.png[] => Here the correct path is : image:image_name.png[]`
  • link:../architecture/ADR/unePage.html[] needed to be link:architecture/ADR/unePage.html[]

The same issue happen with attachments, links, images .

The error log : {"level":"fatal","time":1720179763956,"name":"antora","err":{"type":"TypeError","stack":"TypeError\n at /node_modules/antora-confluence/dist/lib/transformer/LinkTransformer.js:98:140\n at Array.forEach (<anonymous>)\n at rewriteInternalLinks (/node_modules/antora-confluence/dist/lib/transformer/LinkTransformer.js:77:41)\n at processPage (/node_modules/antora-confluence/dist/lib/service/PageService.js:303:52)\n at publish (/node_modules/antora-confluence/dist/lib/service/PageService.js:187:40)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async publish (/node_modules/antora-confluence/dist/lib/service/PageService.js:281:13)\n at async publish (/node_modules/antora-confluence/dist/lib/service/PageService.js:281:13)\n at async publish (/node_modules/antora-confluence/dist/lib/service/PageService.js:281:13)"},"msg":"Cannot read properties of undefined (reading 'pageTitle')"}

Hope this helps !

Thanks for your fast answer !

TitouanM avatar Jul 05 '24 11:07 TitouanM