hugo-theme-hello-friend/layouts/partials/menu.html

39 lines
1.3 KiB
HTML
Raw Normal View History

2018-07-20 19:14:22 +02:00
<nav class="menu">
2019-02-01 10:06:44 +01:00
<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 }}
2019-02-01 15:53:23 +01:00
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
<ul class="menu__sub-inner">
2019-02-05 14:22:41 +01:00
<li class="menu__sub-inner-more-trigger">{{ $.Site.Params.MenuMore | default "Show more" }} <span class="menu__sub-inner-more-trigger-icon">></span></li>
2019-02-01 10:06:44 +01:00
<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>
2019-02-01 15:53:23 +01:00
</ul>
{{ end }}
2019-02-01 10:06:44 +01:00
{{ 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">
2019-01-29 11:11:48 +01:00
{{ range $.Site.Menus.main }}
2019-02-01 10:06:44 +01:00
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
2018-07-20 19:14:22 +02:00
{{ end }}
</ul>
2019-01-29 11:11:48 +01:00
</nav>