Hugo-theme-zzo: How to open Markdown link in a new tab

Created on 17 Jan 2020  路  3Comments  路  Source: zzossig/hugo-theme-zzo

I was wondering how to add target="_blank" to a Markdown link.
I tried like below but it didn't work:

[Hugo Host on GitHub](https://gohugo.io/hosting-and-deployment/hosting-on-github/){:target="_blank"}

All 3 comments

I鈥檒l add this feature soon

I just found that {:target="_blank"} is not the part of the Goldmark syntax which is Hugo's markdown rendering library.
So, if you want to use target=_blank in Goldmark, You should follow this link
https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks

Or, just use

<a href="http://..." target="_blank">external link</a>

in the markdown file.

Since the markdown render hooks makes all the links to open in a new tab, I'm not going to use it in the theme as default.

So, just use the a tag.

I just found that {:target="_blank"} is not the part of the Goldmark syntax which is Hugo's markdown rendering library.
So, if you want to use target=_blank in Goldmark, You should follow this link
https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks

Or, just use

<a href="http://..." target="_blank">external link</a>

in the markdown file.

Since the markdown render hooks makes all the links to open in a new tab, I'm not going to use it in the theme as default.

So, just use the a tag.

Ok, thanks for your help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nisrulz picture nisrulz  路  3Comments

nisrulz picture nisrulz  路  4Comments

Gictorbit picture Gictorbit  路  6Comments

nisrulz picture nisrulz  路  4Comments

nisrulz picture nisrulz  路  5Comments