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.5KB

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