Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

navigation.html 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <section class="sticky-top navigation">
  2. <div class="container">
  3. <nav class="navbar navbar-expand-lg navbar-dark">
  4. <a class="navbar-brand p-0" href="{{ .Site.BaseURL | relLangURL }}">
  5. {{ if .Site.Params.logo }}
  6. <img class="img-fluid" src="{{ .Site.Params.logo | absURL }}" alt="{{ .Site.Title }}">
  7. {{ else }}
  8. {{ .Site.Title }}
  9. {{ end }}
  10. </a>
  11. <button class="navbar-toggler rounded-0" type="button" data-toggle="collapse" data-target="#navigation">
  12. <span class="navbar-toggler-icon"></span>
  13. </button>
  14. <div class="collapse navbar-collapse" id="navigation">
  15. <ul class="navbar-nav ml-auto">
  16. <li class="nav-item"><a class="nav-link" href="#body">{{ .Site.Params.home }}</a></li>
  17. {{ if .IsHome }}
  18. {{ range .Site.Menus.main }}
  19. <li class="nav-item"><a class="nav-link" href="#{{ .URL }}">{{ .Name }}</a></li>
  20. {{ end }}
  21. {{ else }}
  22. {{ range .Site.Menus.main }}
  23. <li class="nav-item"><a class="nav-link" href="{{ $.Site.BaseURL | relLangURL }}#{{ .URL }}">{{ .Name }}</a>
  24. </li>
  25. {{ end }}
  26. {{ end }}
  27. {{ range .Site.Menus.static }}
  28. <li class="nav-item"><a class="nav-link" target="_blank" href="{{ .URL }}">{{ .Name }}</a>
  29. </li>
  30. {{ end }}
  31. </ul>
  32. <!-- Language List -->
  33. {{- if .Site.IsMultiLingual }}
  34. <select id="select-language" onchange="location = this.value;">
  35. {{ $siteLanguages := .Site.Languages}}
  36. {{ $pageLang := .Page.Lang}}
  37. {{ range .Page.AllTranslations }}
  38. {{ $translation := .}}
  39. {{ range $siteLanguages }}
  40. {{ if eq $translation.Lang .Lang }}
  41. {{ $selected := false }}
  42. {{ if eq $pageLang .Lang}}
  43. <option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}
  44. </option>
  45. {{ else }}
  46. <option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
  47. {{ end }}
  48. {{ end }}
  49. {{ end }}
  50. {{ end }}
  51. </select>
  52. {{ end }}
  53. </div>
  54. </nav>
  55. </div>
  56. </section>