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

nav.html « partials « layouts - github.com/zwbetz-gh/vanilla-bootstrap-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9ca3c7c061cb7c7e2b770a920796b1d319a35045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<div id="nav-border" class="container">
  <nav id="nav" class="nav justify-content-center">
  {{ $showActiveNav := .Site.Params.showActiveNav }}
  {{ $currentPage := . }}
  {{ range .Site.Menus.main }}
    {{ $active := "" }}
    {{ if eq $showActiveNav true }}
      {{ $isMenu := or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
      {{ if or $isMenu (eq $currentPage.Title .Name) }} 
        {{ $active = "nav-link-active" }}
      {{ end }}  
    {{ end }}  
    {{ $icon := printf "<i data-feather=\"%s\"></i>" .Pre }}
    {{ $text := print $icon " " .Name | safeHTML }}
    <a class="nav-link {{ $active }}" href="{{ .URL }}">{{ $text }}</a>
  {{ end }}
  </nav>
</div>