How to render markdown url with .md to correct link

I’m new to Hugo and I’m trying to use Hugo to generate a site for docs.

I have links to other files in docs using markdown markups:

[Title](linked-file.md)

But link like this are not rendered to correct links like linked-file.html

I know there are shortcodes for links, but I would like to keep using markup since it can work in GitHub repo to the correct .md file.

So I am asking if there is a way to render

[Title](linked-file.md)

to

<a href="linked-file.html">Title</a>

Thanks

1 Like

You are looking for https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks

thank you.

I saw it is said can be used as Resolve link references using .GetPage. This would make links portable as you could translate ./my-post.md (and similar constructs that would work on GitHub) into /blog/2019/01/01/my-post/ etc. However I can’t get this work right.

There are examples, you’ll need to search for them. I don’t personally use them. :slight_smile:

thanks so much

this solved my problem :star_struck:

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