Website Summary Files Commits Branches @commit @diff @stats
path: root / website / layouts / partials / nav.html
blob: 8d7cf30c46285e68f017c3b99674f0e81b9b81c7 (plain) (blame)
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
{{- $params := .Site.Params }}
{{- $centerLogo := $params.centerLogo }}
{{ $logo := $params.logo }}
<header class = 'nav_header' >
  <nav class = 'nav'>
    <a href='{{ absURL "" }}' class = 'nav_brand nav_item{{ if eq $centerLogo true }} nav_hide{{ end }}'>
      {{- with $logo }}
      <img src="{{ absURL .url }}" width="{{ .width }}" height="{{ .height }}" class="logo">
      {{- else }}
        {{ .Site.Title }}
      {{- end }}
      <div class = 'nav_close'>
        <svg class="icon">
          <use xlink:href="#open-menu"></use>
        </svg>
        <svg class="icon">
          <use xlink:href="#closeme"></use>
        </svg>
      </div>
    </a>
    <div class = 'nav_body nav_body_{{ .Site.Params.mobileNavigation }}'>
      {{- $link := .RelPermalink }}
      {{- range .Site.Data.menu }}
      <div class = 'nav_parent{{ if eq .link $link }} nav_active{{ end}}'>
        <a href = '{{ absURL .link }}' class = 'nav_item'>{{ .name }} {{ with .submenu }}<img src= {{ absURL "icons/caret-icon.svg" }} alt="icon" class="nav_icon">{{ end }}</a>
        {{- with .submenu }}
        <div class = 'nav_sub'>
          {{- range . }}
          <a href = '{{ absURL .link }}' class = 'nav_child nav_item'>{{ .name }}</a>
          {{- end }}
        </div>
        {{- end }}
      </div>
      {{- end }}
      {{- if eq $centerLogo true }}
      <a href='{{ absURL "" }}' class = 'nav_brand nav_center nav_item'>
        <img src="{{ absURL $logo }}" class="logo">
      </a>
      {{- end }}
      {{- partial "follow" . }}
    </div>
  </nav>
</header>