mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-22 15:55:08 +01:00
39 lines
1.3 KiB
HTML
39 lines
1.3 KiB
HTML
<nav class="menu">
|
|
<ul class="menu__inner menu__inner--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 }}">{{ .Name }}</a></li>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
|
|
<ul class="menu__sub-inner">
|
|
<li class="menu__sub-inner-more-trigger">{{ $.Site.Params.MenuMore | default "Show more" }} <span class="menu__sub-inner-more-trigger-icon">></span></li>
|
|
|
|
<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>
|
|
{{ end }}
|
|
{{ end }}
|
|
</ul>
|
|
</ul>
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ range $.Site.Menus.main }}
|
|
{{ if not .HasChildren }}
|
|
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
</ul>
|
|
|
|
<ul class="menu__inner menu__inner--mobile">
|
|
{{ range $.Site.Menus.main }}
|
|
{{ if not .HasChildren }}
|
|
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
|
{{ end }}
|
|
{{ end }}
|
|
</ul>
|
|
</nav>
|