Is there a way to generate a valid URL from asciidoc link:file.adoc[title]

I have a hugo project structure like this:


There is a cross-reference to the a.doc in b.adoc

link:a.adoc[The page "a"]

Hugo renders the link to the URL like this: site_url/a.doc
But this page doesn’t exist and i get 404 when going to the URL. The valid URL is site_url//a

Is there a way for generating a valid URL like above? There may be a solution similar to markdown-render-hooks?


I found this way:
link:{{< ref "_somefile_.adoc" >}}[_link text_]
but in this case, the adoc syntax breaks and the link becomes non-clickable on github

Render hooks… no.

Note that this is only supported with the Goldmark renderer.

But this might work for you:

:relfileprefix: ../
:relfilesuffix: /


@jmooring it works!
thank you very much for your help!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.