~mrls/essential

ref: 27db479c55a5cd10042f4854d33412efe57cf682 essential/layouts/partials/nav.html -rw-r--r-- 504 bytes
27db479cMauro Morales Add pic archetypes 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{ $currentPage := . }}
<div id="nav">
  <ul class="nav navbar-nav">
    {{ range .Site.Menus.main }}
    <li>
      {{ $active := or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
      {{ $active = or $active (eq .Name $currentPage.Title) }}
      {{ $active = or $active (eq .Name $currentPage.Section) }}
      <a class="{{- if $active -}}open{{- end -}}"
         href="{{ .URL }}">
        <span>{{ .Name }}</span>
      </a>
    </li>
    {{ end }}
  </ul>
</div>