# How to use "Previous post" inside markdown content

**URL:** <https://discourse.gohugo.io/t/how-to-use-previous-post-inside-markdown-content/7756>\
**Category:** support\
**Created:** [August 7, 2017, 4:15pm UTC](https://discourse.gohugo.io/t/how-to-use-previous-post-inside-markdown-content/7756 "2017-08-07T16:15:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yamila-moreno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/yamila-moreno/32/3823_2.png) [@yamila-moreno](https://discourse.gohugo.io/u/yamila-moreno)\
**Post date:** [August 7, 2017, 4:15pm UTC](https://discourse.gohugo.io/t/how-to-use-previous-post-inside-markdown-content/7756/1 "2017-08-07T16:15:28Z")

</div>

Hi there, I’ve been using Hugo for several months, and I’m very happy, thanks for hugo 😃

I’m writing a post and I’d like to link to the previous post (inside the markdown), but I cannot find the precise line. Looking at my theme and other themes, I’ve tried different ways of:

```auto
In this <a href="{{ .Paginator.Prev.URL }}" target="_new">previous post</a>
In this <a href="{{ .Prev }}" target="_new">previous post</a>

```

and so on…

The problem is that when I type `hugo server`, hugo doesn’t seem to convert the “{{ }}” into the proper url. Any hint would be very helpful.

Thanks in advance for your time! 😃

---

<div class="post-metadata">

**Author:** ![digitalcraftsman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/digitalcraftsman/32/4142_2.png) [@digitalcraftsman](https://discourse.gohugo.io/u/digitalcraftsman)\
**Post date:** [August 7, 2017, 6:41pm UTC](https://discourse.gohugo.io/t/how-to-use-previous-post-inside-markdown-content/7756/2 "2017-08-07T18:41:54Z")

</div>

Hello @yamila-moreno,

the problem is that Hugo doesn’t treat as templates. Therefore, `{{ .Paginator.Prev.URL }}` will not return the link to the previous post.

[Shortcodes](https://gohugo.io/content-management/shortcodes/) were introduced to fix this limitations. Shortcodes are like small, reusable templates that can be embedded into your content files.

If the prev / next links are at the very end of your post (or a similar position) it might be easier to add them to the actual templates instead.

---

<div class="post-metadata">

**Author:** ![yamila-moreno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/yamila-moreno/32/3823_2.png) [@yamila-moreno](https://discourse.gohugo.io/u/yamila-moreno)\
**Post date:** [August 7, 2017, 7:15pm UTC](https://discourse.gohugo.io/t/how-to-use-previous-post-inside-markdown-content/7756/3 "2017-08-07T19:15:00Z")

</div>

Hello @digitalcraftsman, thanks for your quick response. Thanks to your link I found `rel` shortcode which will serve perfectly.

Best,  
Yamila.
