You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.0 KiB

4 years ago
  1. <nav class="menu">
  2. <ul class="menu__inner menu__inner--desktop">
  3. {{ if or $.Site.Params.showMenuItems ( eq .Site.Params.showMenuItems 0 ) }}
  4. {{ range first $.Site.Params.showMenuItems $.Site.Menus.main }}
  5. {{ if not .HasChildren }}
  6. <li><a href="{{ .URL }}">{{ .Name }}</a></li>
  7. {{ end }}
  8. {{ end }}
  9. {{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
  10. <ul class="menu__sub-inner">
  11. <li class="menu__sub-inner-more-trigger">{{ $.Site.Params.MenuMore }} ▾</li>
  12. <ul class="menu__sub-inner-more hidden">
  13. {{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
  14. {{ if not .HasChildren }}
  15. <li><a href="{{ .URL }}">{{ .Name }}</a></li>
  16. {{ end }}
  17. {{ end }}
  18. </ul>
  19. </ul>
  20. {{ end }}
  21. {{ else }}
  22. {{ range $.Site.Menus.main }}
  23. {{ if not .HasChildren }}
  24. <li><a href="{{ .URL }}">{{ .Name }}</a></li>
  25. {{ end }}
  26. {{ end }}
  27. {{ end }}
  28. {{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
  29. <div class="spacer"></div>
  30. <ul class="language-selector">
  31. <ul class="language-selector-current">
  32. <li>{{ .Language.LanguageName }} ▾</li>
  33. </ul>
  34. <ul class="language-selector__more hidden">
  35. {{ range $.Site.Home.AllTranslations }}
  36. <li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
  37. {{ end }}
  38. </ul>
  39. </ul>
  40. {{ end }}
  41. </ul>
  42. <ul class="menu__inner menu__inner--mobile">
  43. {{ range $.Site.Menus.main }}
  44. {{ if not .HasChildren }}
  45. <li><a href="{{ .URL }}">{{ .Name }}</a></li>
  46. {{ end }}
  47. {{ end }}
  48. {{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
  49. <hr />
  50. {{ range $.Site.Home.AllTranslations }}
  51. <li>
  52. <a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
  53. </li>
  54. {{ end }}
  55. {{ end }}
  56. </ul>
  57. </nav>