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

61 lines
2 KiB
HTML
Raw Normal View History

2019-01-28 03:11:02 +03:00
<nav class="menu">
2019-02-01 00:06:54 +03:00
<ul class="menu__inner menu__inner--desktop">
2019-02-01 12:15:28 +03:00
{{ if or $.Site.Params.showMenuItems ( eq .Site.Params.showMenuItems 0 ) }}
2019-02-01 00:06:54 +03:00
{{ range first $.Site.Params.showMenuItems $.Site.Menus.main }}
2019-02-01 10:39:12 +03:00
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
2019-02-01 00:06:54 +03:00
{{ end }}
2019-02-01 18:00:11 +03:00
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
<ul class="menu__sub-inner">
2019-02-01 00:06:54 +03:00
<li class="menu__sub-inner-more-trigger">{{ $.Site.Params.MenuMore }} ▾</li>
<ul class="menu__sub-inner-more hidden">
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
2019-02-01 10:39:12 +03:00
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
2019-02-01 00:06:54 +03:00
{{ end }}
</ul>
2019-02-01 18:00:11 +03:00
</ul>
{{ end }}
2019-02-01 00:06:54 +03:00
{{ else }}
{{ range $.Site.Menus.main }}
2019-02-01 10:39:12 +03:00
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
2019-02-01 00:06:54 +03:00
{{ end }}
{{ end }}
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
<div class="spacer"></div>
2019-08-13 09:44:40 +03:00
<ul class="language-selector">
<ul class="language-selector-current">
<li>{{ .Language.LanguageName }} ▾</li>
</ul>
<ul class="language-selector__more hidden">
{{ range $.Site.Home.AllTranslations }}
2019-08-13 09:44:40 +03:00
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
2019-08-13 09:44:40 +03:00
</ul>
</ul>
{{ end }}
2019-02-01 00:06:54 +03:00
</ul>
<ul class="menu__inner menu__inner--mobile">
2019-01-29 13:18:14 +03:00
{{ range $.Site.Menus.main }}
2019-02-01 10:39:12 +03:00
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
2019-01-28 03:11:02 +03:00
{{ end }}
2020-11-16 02:25:10 +03:00
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
<hr />
2020-11-16 02:25:10 +03:00
{{ range $.Site.Home.AllTranslations }}
<li>
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
</li>
{{ end }}
{{ end }}
2019-01-28 03:11:02 +03:00
</ul>
2019-01-29 13:18:14 +03:00
</nav>