# How to render markdown url with .md to correct link

**URL:** <https://discourse.gohugo.io/t/how-to-render-markdown-url-with-md-to-correct-link/26372>\
**Category:** support\
**Created:** [June 19, 2020, 5:04pm UTC](https://discourse.gohugo.io/t/how-to-render-markdown-url-with-md-to-correct-link/26372 "2020-06-19T17:04:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arisac](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arisac](https://discourse.gohugo.io/u/arisac)\
**Post date:** [June 19, 2020, 5:04pm UTC](https://discourse.gohugo.io/t/how-to-render-markdown-url-with-md-to-correct-link/26372/1 "2020-06-19T17:04:38Z")

</div>

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:

```auto
[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

```auto
[Title](linked-file.md)

```

to

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

```

Thanks

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [June 19, 2020, 5:51pm UTC](https://discourse.gohugo.io/t/how-to-render-markdown-url-with-md-to-correct-link/26372/2 "2020-06-19T17:51:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![arisac](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arisac](https://discourse.gohugo.io/u/arisac)\
**Post date:** [June 19, 2020, 6:14pm UTC](https://discourse.gohugo.io/t/how-to-render-markdown-url-with-md-to-correct-link/26372/4 "2020-06-19T18:14:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [June 19, 2020, 8:12pm UTC](https://discourse.gohugo.io/t/how-to-render-markdown-url-with-md-to-correct-link/26372/5 "2020-06-19T20:12:59Z")

</div>

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

> [@Relative Markdown Links - Markdown Render Hooks](https://discourse.gohugo.io/t/relative-markdown-links-markdown-render-hooks/22674):
>
> The minimal example for relative markdown links: [My Article](../my-article/index.md) Template: /layouts/\_default/\_markup/render-link.html \<a href="{{ (.Page.GetPage .Destination).RelPermalink | safeURL }}"\>{{ .Text | safeHTML }}\</a\> For more complex example in the test project, follow: [https://github.com/bep/portable-hugo-links](https://github.com/bep/portable-hugo-links)

---

<div class="post-metadata">

**Author:** ![arisac](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arisac](https://discourse.gohugo.io/u/arisac)\
**Post date:** [June 19, 2020, 8:34pm UTC](https://discourse.gohugo.io/t/how-to-render-markdown-url-with-md-to-correct-link/26372/6 "2020-06-19T20:34:00Z")

</div>

thanks so much

this solved my problem 🤩

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [June 21, 2020, 8:34pm UTC](https://discourse.gohugo.io/t/how-to-render-markdown-url-with-md-to-correct-link/26372/7 "2020-06-21T20:34:04Z")

</div>

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