mirror of
https://github.com/panr/hugo-theme-terminal.git
synced 2024-11-26 03:25:32 +03:00
9726b8d806
This commit belongs to the PR: https://github.com/panr/hugo-theme-terminal/pull/370 by @matidfk
33 lines
1.3 KiB
HTML
33 lines
1.3 KiB
HTML
<nav class="navigation-menu">
|
|
<ul class="navigation-menu__inner menu--desktop">
|
|
{{ 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 }}" {{ if .Params.NewTab -}} target="_blank" {{- end }}>{{ .Name }}</a></li>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
|
|
<li>
|
|
<ul class="menu">
|
|
<li class="menu__trigger">{{ $.Site.Params.MenuMore }} ▾</li>
|
|
<li>
|
|
<ul class="menu__dropdown">
|
|
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
|
|
{{ if not .HasChildren }}
|
|
<li><a href="{{ .URL }}" {{ if .Params.NewTab -}} target="_blank" {{- end }}>{{ .Name }}</a></li>
|
|
{{ end }}
|
|
{{ end }}
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ range $.Site.Menus.main }}
|
|
{{ if not .HasChildren }}
|
|
<li><a href="{{ .URL }}" {{ if .Params.NewTab -}} target="_blank" {{- end }}>{{ .Name }}</a></li>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
</ul>
|
|
</nav>
|