How do I open external links in new tab .
I have set this :
[blackfriday]
hrefTargetBlank = true
in my config.toml
But my mark down link does not open in a new tab ex:
cat plex.md
+++
weight = 0
draft = false
date = "2017-04-05T23:08:19-04:00"
title = "plex"
link = “http://fox.tnt.int:32400 ”
+++
bep
April 7, 2017, 7:01am
2
Har to tell without seeing the full project, but one guess could be that your config.toml is somewhat invalid.
You can try
hugo config
And check that your blackfriday config is read OK.
Also check that only other maps follows the blackfriday section (see the TOML spec).
Jura
April 7, 2017, 11:19am
3
If you configure the link in the front matter (i.e., link
), then it seems to me that you’re accessing that link in your theme template file? (Like .Params.link
).
If that’s the case, then it’s normal that the links don’t open in a new tab – since the theme template files aren’t processed by Blackfriday. (Correct me if I’m mistaken or misunderstand.)
1 Like
Yes you are right Jura. It’s define in the template .
grep href themes/dimension/layouts/index.html
<li>{{ if isset .Params "link" }}<a href="{{ index .Params "link" }}"{{else}}<a href="#{{ .File.TranslationBaseName }}"{{end}}>{{ if .GetParam "menuname" }}{{ .GetParam "menuname" }}{{ else }}{{ .Title }}{{ end }}</a></li>
{{ if $i }}, {{ end }}<a href="{{ .Permalink }}">{{ $e.Language.LanguageName }}</a>
Thanks for your help.