Merge pull request #370 from matidfk/patch-1

Allow target="_blank" with .Params.NewTab set to true
This commit is contained in:
Radek Kozieł 2022-10-22 11:36:14 +02:00 committed by GitHub
commit 4cfc615c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
{{ if or $.Site.Params.showMenuItems ( eq .Site.Params.showMenuItems 0 ) }}
{{ range first $.Site.Params.showMenuItems $.Site.Menus.main }}
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
<li><a href="{{ .URL }}" {{ if .Params.NewTab }} target="_blank" {{ end }}>{{ .Name }}</a></li>
{{ end }}
{{ end }}
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
@ -13,7 +13,7 @@
<ul class="menu__sub-inner-more hidden">
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
<li><a href="{{ .URL }}" {{ if .Params.NewTab }} target="_blank" {{ end }}>{{ .Name }}</a></li>
{{ end }}
{{ end }}
</ul>
@ -22,7 +22,7 @@
{{ else }}
{{ range $.Site.Menus.main }}
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
<li><a href="{{ .URL }}" {{ if .Params.NewTab }} target="_blank" {{ end }}>{{ .Name }}</a></li>
{{ end }}
{{ end }}
{{ end }}
@ -45,7 +45,7 @@
<ul class="menu__inner menu__inner--mobile">
{{ range $.Site.Menus.main }}
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
<li><a href="{{ .URL }}" {{ if .Params.NewTab }} target="_blank" {{ end }}>{{ .Name }}</a></li>
{{ end }}
{{ end }}
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}