Welcome to mirror list, hosted at ThFree Co, Russian Federation.

navbar-2.html « navigators « partials « layouts - github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 40e83b5fa090f993f73284dff43ade0f8e05f5ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{{/* default logos  */}}
{{ $mainLogo := "/images/main-logo.png" }}
{{ $invertedLogo := "/images/inverted-logo.png" }}

{{/* if custom logo has been provided in the config file, then use them */}}
{{ if site.Params.logo.main }}
  {{ $mainLogo = site.Params.logo.main }}
{{ end }}

{{ if site.Params.logo.inverted }}
  {{ $invertedLogo = site.Params.logo.inverted }}
{{ end }}

{{/* resize the logos. don't resize svg because it is not supported */}}
{{ $mainLogo := resources.Get $mainLogo}}
{{ if and $mainLogo (ne $mainLogo.MediaType.SubType "svg") }}
  {{ $mainLogo = $mainLogo.Resize "42x" }}
{{ end }}
{{ $mainLogo = $mainLogo.RelPermalink}}

{{ $invertedLogo := resources.Get $invertedLogo}}
{{ if and $invertedLogo (ne $invertedLogo.MediaType.SubType "svg") }}
  {{ $invertedLogo = $invertedLogo.Resize "42x" }}
{{ end }}
{{ $invertedLogo = $invertedLogo.RelPermalink}}

<nav class="navbar navbar-expand-xl top-navbar final-navbar shadow">
  <div class="container">
      <button class="navbar-toggler navbar-light" id="sidebar-toggler" type="button" onclick="toggleSidebar()">
      <span class="navbar-toggler-icon"></span>
    </button>
    <a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
      <img src="{{ $mainLogo  }}">
      {{- site.Title -}}
    </a>
    <button class="navbar-toggler navbar-light" id="toc-toggler" type="button" onclick="toggleTOC()">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse lang-selector" id="top-nav-items">
      <ul class="navbar-nav ml-auto">
      {{ if .IsTranslated }}
        {{ partial "navigators/lang-selector-2.html" . }}
      {{ end }}
      </ul>
    </div>
  </div>
  <!-- Store the logo information in a hidden img for the JS -->
  <img src="{{ $mainLogo  }}" class="d-none" id="main-logo">
  <img src="{{ $invertedLogo  }}" class="d-none" id="inverted-logo">
</nav>