add menu from categories and implement css active class

This commit is contained in:
Robert Kaussow 2018-10-10 01:10:43 +02:00
parent 1d70ca7a2c
commit e58c165488

View File

@ -9,7 +9,17 @@
<span class="underline">Linux und Open Source Blog</span>
</div>
<div class="mobile" onclick="toogleClass('default-menu');"><span>Menu</span></div>
<nav id="default-menu" class="default">MENU</nav>
<nav id="default-menu" class="default">
<ul id="all-tags">
{{ $currentPage := .Permalink }}
<li><a {{ if eq $currentPage (printf "%s" .Site.BaseURL) }}class="active"{{ end }} href="{{ .Site.BaseURL }}">Blog</a></li>
{{ range $name, $taxonomy := .Site.Taxonomies.categories }}
{{ with $.Site.GetPage (printf "/categories/%s" $name) }}
<li><a {{ if eq $currentPage .Permalink }}class="active"{{ end }} href="{{ .Permalink }}">{{ $name }}</a></li>
{{ end }}
{{ end }}
</ul>
</nav>
</header>
<div id="wrapper">