Allow target="_blank" with .Params.NewTab set to true
example: ``` [[menu.main]] identifier = "discord" name = "Discord" url = "https://discord.gg/..." [menu.main.params] newTab = true ```
This commit is contained in:
parent
1610962731
commit
b824cb3172
@ -3,7 +3,7 @@
|
|||||||
{{ if or $.Site.Params.showMenuItems ( eq .Site.Params.showMenuItems 0 ) }}
|
{{ if or $.Site.Params.showMenuItems ( eq .Site.Params.showMenuItems 0 ) }}
|
||||||
{{ range first $.Site.Params.showMenuItems $.Site.Menus.main }}
|
{{ range first $.Site.Params.showMenuItems $.Site.Menus.main }}
|
||||||
{{ if not .HasChildren }}
|
{{ 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 }}
|
{{ end }}
|
||||||
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
|
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<ul class="menu__sub-inner-more hidden">
|
<ul class="menu__sub-inner-more hidden">
|
||||||
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
|
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
|
||||||
{{ if not .HasChildren }}
|
{{ 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 }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
{{ else }}
|
{{ else }}
|
||||||
{{ range $.Site.Menus.main }}
|
{{ range $.Site.Menus.main }}
|
||||||
{{ if not .HasChildren }}
|
{{ 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 }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<ul class="menu__inner menu__inner--mobile">
|
<ul class="menu__inner menu__inner--mobile">
|
||||||
{{ range $.Site.Menus.main }}
|
{{ range $.Site.Menus.main }}
|
||||||
{{ if not .HasChildren }}
|
{{ 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 }}
|
{{ end }}
|
||||||
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
|
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
|
||||||
|
Loading…
Reference in New Issue
Block a user