summaryrefslogtreecommitdiff
path: root/layouts/partials/header.html
blob: 0d8ac71dd1a3dd3426550cf305b7a0d38f22e503 (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
<div id="site-header">
  <nav id="global-nav">
    {{ range .Site.Params.navLinks }}
      {{ $path := index . 1 }}
      <a href="{{ $path }}"
         {{ if $.Params.navPath }}
           {{ if ne $.Params.navPath "" }}
             {{ $p := printf "/%s" $.Params.navPath | printf "%s" }}

             {{ if eq $path $p }}
               id="nav-link-active"
             {{ end }}
           {{ end }}
         {{ else }}
           {{ if ne $.Section "" }}
             {{ $p := printf "/%s" $.Section | printf "%s" }}

             {{ if eq $path $p }}
               id="nav-link-active"
             {{ end }}
           {{ end }}
         {{ end }}
      >
        {{ index . 0 }}
      </a>
    {{ end }}
  </nav>
</div>