Merge pull request #386 from rseabra/fix-menus

Fix menu's by properly enclosing the inner ul's into li's as it shoul…
This commit is contained in:
Radek Kozieł 2022-11-06 09:13:48 +01:00 committed by GitHub
commit 1023b03b77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,17 +7,20 @@
{{ 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 }} ▾</li>
<ul class="menu__sub-inner-more hidden">
<li>
<ul class="menu__sub-inner">
<li class="menu__sub-inner-more-trigger">{{ $.Site.Params.MenuMore }} ▾</li>
<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>
</li>
</ul>
</ul>
</li>
{{ end }}
{{ else }}
{{ range $.Site.Menus.main }}
@ -28,17 +31,20 @@
{{ end }}
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
<div class="spacer"></div>
<ul class="language-selector">
<ul class="language-selector-current">
<li>{{ .Language.LanguageName }} ▾</li>
<!-- <div class="spacer"></div> -->
<li>
<ul class="language-selector">
<li>
<ul class="language-selector-current">
<li>{{ .Language.LanguageName }} ▾</li>
</ul>
<ul class="language-selector__more hidden">
{{ range $.Site.Home.AllTranslations }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
</ul>
<ul class="language-selector__more hidden">
{{ range $.Site.Home.AllTranslations }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
</ul>
</li>
{{ end }}
</ul>