diff options
Diffstat (limited to 'layouts/partials/nav.html')
-rw-r--r-- | layouts/partials/nav.html | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 8d0a343..325f72b 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -1,18 +1,16 @@ -<div class="navbar-affixed-top" data-spy="affix" data-offset-top="200"> - - <div class="navbar navbar-default yamm" role="navigation" id="navbar"> - +<header class="navbar-affixed-top" data-spy="affix" data-offset-top="62"> + <div class="navbar navbar-default yamm" role="navigation" id="navbar"> <div class="container"> <div class="navbar-header"> - <a class="navbar-brand home" href="{{ .Site.BaseURL }}"> - <img src="{{ .Site.BaseURL }}img/logo.png" alt="{{ .Title }} logo" class="hidden-xs hidden-sm"> - <img src="{{ .Site.BaseURL }}img/logo-small.png" alt="{{ .Title }} logo" class="visible-xs visible-sm"> + <a class="navbar-brand home" href="{{ "/" | relURL }}"> + <img src="{{ .Site.Params.logo | relURL }}" alt="{{ .Title }} logo" class="hidden-xs hidden-sm"> + <img src="{{ .Site.Params.logo_small | relURL }}" alt="{{ .Title }} logo" class="visible-xs visible-sm"> <span class="sr-only">{{ .Title }} - {{ i18n "navHome" }}</span> </a> <div class="navbar-buttons"> <button type="button" class="navbar-toggle btn-template-main" data-toggle="collapse" data-target="#navigation"> <span class="sr-only">{{ i18n "navToggle" }}</span> - <i class="fa fa-align-justify"></i> + <i class="fas fa-align-justify"></i> </button> </div> </div> @@ -20,11 +18,13 @@ <div class="navbar-collapse collapse" id="navigation"> <ul class="nav navbar-nav navbar-right"> + {{ $current := . }} + {{ $topLevel := replace .URL "/" "" }} {{ range .Site.Menus.main.ByWeight }} {{ if .HasChildren }} <!-- Check if the first child marks a menu section identifier --> {{ $hasSections := (hasPrefix (index .Children 0).Identifier "section.") }} - <li class="dropdown{{ if $hasSections }} use-yamm yamm-fw{{end}}"> + <li class="dropdown{{ if $hasSections }} use-yamm yamm-fw{{end}} {{ if eq $current.RelPermalink .URL | or (eq $current.Type $topLevel) | or (and (eq (default (trim .URL "/") .Identifier) "blog") (in (slice "taxonomy" "taxonomyTerm") $current.Kind)) }} active{{ end }}"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ .Name }} <span class="caret"></span></a> {{ if $hasSections }} <ul class="dropdown-menu"> @@ -120,26 +120,19 @@ </div> <!--/.nav-collapse --> - <div class="collapse clearfix" id="search"> - + <div class="collapse clearfix" id="search"> <form class="navbar-form" role="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search"> <span class="input-group-btn"> - - <button type="submit" class="btn btn-template-main"><i class="fa fa-search"></i></button> - + <button type="submit" class="btn btn-template-main"><i class="fas fa-search"></i></button> </span> </div> </form> - </div> <!--/.nav-collapse --> - </div> </div> - <!-- /#navbar --> - -</div> +</header> <!-- *** NAVBAR END ***--> |