hugo-theme-re-terminal/layouts/partials/menu.html

69 lines
2.3 KiB
HTML
Raw Normal View History

2022-06-21 15:15:11 +00:00
<nav class="menu hidden-on-mobile">
2022-06-21 13:50:51 +00: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 }}
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
<li>
<ul class="menu__sub-inner">
<li class="menu__sub-inner-more-trigger">{{ $.Site.Params.MenuMore }}&nbsp;</li>
<li>
<ul class="menu__sub-inner-more hidden">
2022-11-06 08:16:27 +00:00
{{ 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>
</li>
2022-06-21 13:50:51 +00:00
</ul>
</li>
2022-06-21 13:50:51 +00:00
{{ end }}
{{ else }}
{{ range $.Site.Menus.main }}
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
<span class="spacer"></span>
<ul class="menu__inner menu__inner--desktop">
2022-06-21 13:50:51 +00:00
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
<li>
<ul class="language-selector">
<li class="language-selector-current">
{{ .Language.LanguageName }}&nbsp;
</li>
<li>
<ul class="language-selector__more hidden">
2022-11-06 08:16:27 +00:00
{{ range $.Site.Home.AllTranslations }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
</li>
2022-06-21 13:50:51 +00:00
</ul>
</li>
2022-06-21 13:50:51 +00:00
{{ 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 }}
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
2022-11-06 08:16:27 +00:00
<hr />
2022-06-21 13:50:51 +00:00
{{ range $.Site.Home.AllTranslations }}
<li>
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
</li>
{{ end }}
{{ end }}
</ul>
</nav>