Add target="_blank" automatically to navbar items

This commit is contained in:
BBaoVanC 2022-04-27 21:51:26 -05:00
parent 2f6d67a03f
commit 219f97bc00
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A

View File

@ -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>