feat: add nav bar menu items

This commit is contained in:
SerKo 2022-04-12 01:33:08 +08:00
parent ba25d8646d
commit e2141f3b44
1 changed files with 22 additions and 4 deletions

View File

@ -14,11 +14,29 @@
align-items:center align-items:center
"> ">
<div class="mr:8"> <div class="mr:8">
<a class="mr-3 font:extralight">Holy</a> <a href="/" class="mr-3 font:extralight">Holy</a>
</div>
<div>
{{ $currentPage := . }}
{{ $active := "" }}
{{ range .Site.Menus.main }}
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
{{ $active = "active" }}
{{ end }}
<a class="
font:semibold
font:gray-80
font:gray-60:hover
font:gray-40.active
px:8
{{ $active }}
" href="{{ .URL }}" title="{{ .Title }}">
{{ .Name }}
</a>
{{ end }}
</div> </div>
{{ $navBtn := `font:semibold px:8` }}
<a class="{{ $navBtn }}">Home</a>
<a class="{{ $navBtn }}">About</a>
</div> </div>
</nav> </nav>