Commit 196c9bc5 authored by key-amb's avatar key-amb
Browse files

Set active when selected

parent ff9a05e1
......@@ -34,8 +34,10 @@
<ul class="nav navbar-nav">
<li {{ if eq $isHomePage true }}class="active"{{ end }}><a href="{{ $baseUrl }}/">Home</a></li>
{{ if isset .Site.Params "mainMenu" }}
{{ $url := .Permalink }}
{{ range $item := .Site.Params.mainMenu }}
<li><a href="{{ $baseUrl }}/{{ $item }}">{{ title $item}}</a></li>
{{ $itemUrl := printf "%s/%s/" $baseUrl $item }}
<li {{ if eq $url $itemUrl }}class="active"{{ end }}><a href="{{ $baseUrl }}/{{ $item }}">{{ title $item }}</a></li>
{{ end }}
{{ end }}
{{ if isset .Site.Params "noCategoryLink" }}{{ else }}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment