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

header.html « header « partials « layouts - github.com/h-enk/doks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0fa4910fb445fd544b5d1df20a4759906a2c5cb6 (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
<!-- <div class="header-bar fixed-top"></div> -->
<header x-data="{ open: false }" class="navbar fixed-top navbar-expand-md navbar-light">
  <div class="container">
    <a class="navbar-brand order-0 mr-auto" href="{{ .Site.BaseURL }}">{{ .Site.Params.Title }}</a>
    <button id="mode" class="btn btn-link order-1 order-md-4" type="button" aria-label="Toggle mode">
      <span class="toggle-dark"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg></span>
      <span class="toggle-light"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg></span>
    </button>
    <ul class="navbar-nav social-nav order-2 order-md-5">
      {{ range .Site.Menus.social -}}
        <li class="nav-item">
          <a class="nav-link" href="{{ .URL | absLangURL }}" target="_blank" rel="noreferrer noopener">{{ .Pre | safeHTML }}<span class="ml-2 sr-only">{{ .Name | safeHTML }}</span></a>
        </li>
      {{ end -}}
    </ul>
    <button @click="open = true" id="navigation" class="btn btn-link order-3 d-md-none" type="button" aria-expanded="false" aria-label="Toggle navigation">
      <svg x-bind:class="{ 'd-none': open }" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>
      <svg class="d-none" x-bind:class="{ 'd-block': open }" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
    </button>
    <div x-show="open" @click.away="open = false" x-bind:class="{ 'd-block': open }" class="navbar-collapse order-4 order-md-1">
      <ul class="navbar-nav main-nav mr-auto order-5 order-md-2">
        {{- $current := . -}}
        {{ range .Site.Menus.main -}}
          {{- $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) -}}
          {{- $active = or $active (eq .Name $current.Title) -}}
          {{- $active = or $active (and (eq .Name "Docs") (eq $current.Section "docs")) -}}
          {{- $active = or $active (and (eq .Name "Guides") (eq $current.Section "guides")) -}}
          {{- $active = or $active (and (eq .Name "Blog") (eq $current.Section "blog" "authors")) -}}
          <li class="nav-item{{ if $active }} active{{ end }}">
            <a class="nav-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
          </li>
        {{ end -}}
      </ul>
      <div class="break order-6 d-md-none"></div>
      <form class="navbar-form flex-grow-1 order-7 order-md-3">
        <input class="form-control is-search" type="search" placeholder="Search {{ .Site.Params.Title }} docs..." aria-label="Search {{ .Site.Params.Title }} docs...">
      </form>
    </div>
  </div>
</header>