header.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {{ $colorScheme := default "dark" .Site.Params.header.colorScheme }}
  2. <header class="blog-header">
  3. <nav class="navbar navbar-expand-md navbar-{{ $colorScheme }}">
  4. <div class="container-fluid justify-content-center">
  5. <a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}">
  6. {{ partial "brand" . }}
  7. </a>
  8. <!-- <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false"
  9. aria-label="Toggle navigation">
  10. <span class="navbar-toggler-icon"></span>
  11. </button> -->
  12. <!-- <div class="collapse navbar-collapse justify-content-between" id="navbarNav">
  13. <ul class="navbar-nav">
  14. {{ $url := .RelPermalink | relLangURL }}
  15. {{ range .Site.Menus.main }}
  16. <li class="nav-item">
  17. {{ if eq (hasPrefix .URL "mailto:") true }}
  18. <a class="nav-link" href="{{ .URL }}">{{ .Name }}</a>
  19. {{ else }}
  20. {{ $menuUrl := .URL | relLangURL }}
  21. <a class="nav-link {{ if eq $url $menuUrl }}active{{end}}" href="{{ $menuUrl }}">{{ .Name }}</a>
  22. {{ end }}
  23. </li>
  24. {{ end }}
  25. </ul>
  26. {{ if gt (len .Site.Home.AllTranslations) 1 }}
  27. <ul class="navbar-nav">
  28. <li class="nav-item dropdown">
  29. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  30. {{ i18n "language" }}
  31. </a>
  32. <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
  33. {{ range .Site.Home.AllTranslations }}
  34. <li><a class="dropdown-item" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
  35. {{ end }}
  36. </ul>
  37. </li>
  38. </ul>
  39. {{ end }}
  40. </div> -->
  41. </div>
  42. </nav>
  43. </header>