Updating nav bar to only display when there are menu items in the config file
This commit is contained in:
parent
c1bcf8c340
commit
3675771935
4 changed files with 124 additions and 10 deletions
|
@ -1,9 +1,13 @@
|
|||
<h1 class="site-title">
|
||||
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a>
|
||||
</h1>
|
||||
<nav>
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ if .Site.Menus }}
|
||||
<nav>
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ else }}
|
||||
<nav></nav>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue