# How to render a link inside .Inner

**URL:** <https://discourse.gohugo.io/t/how-to-render-a-link-inside-inner/57598>\
**Category:** support\
**Tags:** shortcodes\
**Created:** [September 28, 2026, 12:27pm UTC](https://discourse.gohugo.io/t/how-to-render-a-link-inside-inner/57598 "2026-09-28T12:27:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![choox](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/choox/32/25912_2.png) [@choox](https://discourse.gohugo.io/u/choox)\
**Post date:** [September 28, 2026, 12:27pm UTC](https://discourse.gohugo.io/t/how-to-render-a-link-inside-inner/57598/1 "2026-09-28T12:27:30Z")

</div>

Hello,

I am trying a write a very simple shortcode, its core functionality looks like this:

```auto
<!-- layouts/_shortcodes/test.html -->
<div class="some-class">
  {{ .Inner }}
</div>

```

Now I want to render a link inside the `<div>` such as

```auto
{{< test >}}
[Link A]({{% relref "/books/book-1" %}})
{{< /test >}}

```

It does not render the link for me, and only shows the code. I tried doing `{{ .Inner | Page.RenderString }}` and `{{ .Inner | markdownify }}` but the problem persists.

Instead of `<a href="/en/books/book-1/">Link A</a>` my rendered output remains `[Link A]({{% relref "/books/book-1" %}})`.

Thank you.

---

<div class="post-metadata">

**Author:** ![chrillek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrillek/32/19797_2.png) [@chrillek](https://discourse.gohugo.io/u/chrillek)\
**Post date:** [September 28, 2026, 12:49pm UTC](https://discourse.gohugo.io/t/how-to-render-a-link-inside-inner/57598/2 "2026-09-28T12:49:35Z")

</div>

To quote the docs: `.Inner`

> Returns the content between opening and closing shortcode tags

And that is exactly what’s happening here.

If you go there and read the [next section of the documentation](https://gohugo.io/methods/shortcode/inner/#use-renderstring), you’ll find the answer to your question. Check your spelling carefully!

Though I wouldn’t guarantee that `RenderString` handles shortcodes. OTOH, `relref` is not really needed anymore with a Render Hook.

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [September 28, 2026, 2:46pm UTC](https://discourse.gohugo.io/t/how-to-render-a-link-inside-inner/57598/3 "2026-09-28T14:46:45Z")

</div>

as addition

> [@choox](#):
>
> doing `{{ .Inner | Page.RenderString }}` and

that one should error out. looks like a typo or c’n paste error. recheck the linked example

and yes RenderString handles Shortcodes.

relref checks thet the page exists. the embedded render hook not

---

<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:** [October 20, 2026, 12:31pm UTC](https://discourse.gohugo.io/t/how-to-render-a-link-inside-inner/57598/4 "2026-10-20T12:31:26Z")

</div>

Closed on October 20, 2026, 12:31pm UTC

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