1
0
mirror of https://github.com/BBaoVanC/bobatheme.git synced 2025-06-17 11:37:28 -05:00

Add target="_blank" automatically to navbar items

This commit is contained in:
2022-04-27 21:51:26 -05:00
parent 2f6d67a03f
commit 219f97bc00

@ -13,7 +13,9 @@
{{ if or ($.HasMenuCurrent .Menu .) ($.IsMenuCurrent .Menu .) }} {{ if or ($.HasMenuCurrent .Menu .) ($.IsMenuCurrent .Menu .) }}
{{ $isActive = true }} {{ $isActive = true }}
{{ end }} {{ end }}
<a class="navbar-item{{ if $isActive }} active{{ end }}" href="{{ .URL }}">{{ .Name }}</a> <a class="navbar-item{{ if $isActive }} active{{ end }}"
{{ if strings.HasPrefix .URL "http" }}target="_blank" rel="noopener"{{ end }}
href="{{ .URL }}">{{ .Name }}</a>
{{ end }} {{ end }}
</nav> </nav>