2

I have a hugo project structure like this:

content/
   _index.md
   a.adoc
   b.adoc

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: http://my-site.com/a.doc

But this page doesn't exist and i get 404 when going to the URL. The valid URL is http://my-site.com/a

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

layout
  _default
    _markup
       render-link.html
panov.st
  • 21
  • 3
  • 1
    The link is rendered by Asciidoctor, not Hugo. The link macro is rendered "as is". You would have more control if it was an xref macro. – Richard Smith Feb 20 '22 at 20:12
  • @RichardSmith Thank you! xref works! I found the answer about xref: https://discourse.gohugo.io/t/is-there-a-way-to-generate-a-valid-url-from-asciidoc-link-file-adoc-title/37283/2 – panov.st Feb 21 '22 at 07:39

0 Answers0