# How to "open Link in a new tab" with hugo book

**URL:** <https://discourse.gohugo.io/t/how-to-open-link-in-a-new-tab-with-hugo-book/33872>\
**Category:** support\
**Created:** [July 17, 2021, 12:14pm UTC](https://discourse.gohugo.io/t/how-to-open-link-in-a-new-tab-with-hugo-book/33872 "2021-07-17T12:14:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![volfclub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/volfclub/32/14812_2.png) [@volfclub](https://discourse.gohugo.io/u/volfclub)\
**Post date:** [July 17, 2021, 12:14pm UTC](https://discourse.gohugo.io/t/how-to-open-link-in-a-new-tab-with-hugo-book/33872/1 "2021-07-17T12:14:57Z")

</div>

```auto
$ hugo version
hugo v0.84.0-2C4689F7B+extended windows/amd64 BuildDate=2021-06-18T17:14:27Z VendorInfo=gohugoio

```

* * *

This is my Hugo [repo](https://github.com/volfclub/Awesome-Program-Files) , Hugo theme is [book](https://github.com/alex-shpak/hugo-book).

* * *

```auto
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>

```

`gohugo.io/getting-started/configuration-markup#link-with-title-markdown-example`

* * *

🤨 It’s a little weird, this doesn’t work on the home page `awesome-program-files.vercel.app` ; but the other document pages work `awesome-program-files.vercel.app/docs/example/table-of-contents` . **How to also work on the homepage?**

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [July 18, 2021, 12:02am UTC](https://discourse.gohugo.io/t/how-to-open-link-in-a-new-tab-with-hugo-book/33872/2 "2021-07-18T00:02:53Z")

</div>

Hi there,

The difference is that on your homepage, the links are inside a shortcode ( `{{< columns >}}` ).

Inside the shortcode, [`markdownify`](https://github.com/alex-shpak/hugo-book/blob/master/layouts/shortcodes/columns.html#L4) is being used. However, from [transform.Markdownify | Hugo](https://gohugo.io/functions/markdownify/) :

> _Note_ : if you need [Render Hooks](https://gohugo.io/getting-started/configuration-markup/#markdown-render-hooks), which `markdownify` doesn’t currently support, …

---

<div class="post-metadata">

**Author:** ![volfclub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/volfclub/32/14812_2.png) [@volfclub](https://discourse.gohugo.io/u/volfclub)\
**Post date:** [July 18, 2021, 7:13am UTC](https://discourse.gohugo.io/t/how-to-open-link-in-a-new-tab-with-hugo-book/33872/4 "2021-07-18T07:13:14Z")

</div>

> [@pointyfar](#):
>
> Inside the shortcode, [`markdownify`](https://github.com/alex-shpak/hugo-book/blob/master/layouts/shortcodes/columns.html#L4) is being used. However, from [markdownify | Hugo](https://gohugo.io/functions/markdownify/) :

Thank you very much for your reply.  
I have a general idea of ​​the reason, but I am not sure about the best solution to this problem.

Do you have any great suggestions? ☕

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [July 18, 2021, 2:46pm UTC](https://discourse.gohugo.io/t/how-to-open-link-in-a-new-tab-with-hugo-book/33872/5 "2021-07-18T14:46:29Z")

</div>

```bash
mkdir layouts/shortcodes
cp themes/book/layouts/shortcodes/columns.html layouts/shortcodes/

```

layouts/shortcodes/columns.html

```auto
<div class="book-columns flex flex-wrap">
  {{ range split .Inner "<--->" }}
  <div class="flex-even markdown-inner">
    {{ . | $.Page.RenderString }}
  </div>
  {{ end }}
</div>

```

```auto

```

---

<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:** [July 20, 2021, 2:46pm UTC](https://discourse.gohugo.io/t/how-to-open-link-in-a-new-tab-with-hugo-book/33872/6 "2021-07-20T14:46:31Z")

</div>

Closed on July 20, 2021, 2:46pm UTC

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