Hi,
I’d like to open a menu item on a new tab.
As I understood, the blackfriday option hrefTargetBlank allows opening absolute links in a new tab.
I activated it by adding the following line to the site configuration:
[blackfriday]
hrefTargetBlank = true
In the same config file I have a menu:
[menu]
[[menu.navbar]]
identifier = "id1"
name = "name 1"
url = "/name1.html"
weight = 1
[[menu.navbar]]
identifier = "id2"
name = "name 2"
url = "https://gohugo.io"
weight = 2
In this case, gohugo.io should open in a new tab, right?
This is the code of the menu:
<nav class="nav nav-navbar ">
{{ $currentPage := . }}
{{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
{{ range .Site.Menus.navbar }}
<a class="nav-link {{if or ($currentPage.IsMenuCurrent "navbar" .) ($currentPage.HasMenuCurrent "navbar" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
{{ end }}
</nav>
This is Hugo BF conf:
hugo config|grep -i black
blackfriday = map[hreftargetblank:true]
The external website is not opening in a new tab.
Am I missing something ?