Merge pull request #60 from bhamill638/updating-nav-bar

Having no menu items in config results in empty nav bar with a different background colour on small screens
This commit is contained in:
Dmitry Kolosov 2020-08-29 10:03:24 +03:00 committed by GitHub
commit 95e5785c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -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.main }}
<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 }}

View File

@ -473,7 +473,7 @@ ul.language-select > li {
text-align: center;
}
header nav {
header nav:not(:empty){
background: var(--pagination-bg-color);
margin-top: 1em;
max-width: 100%;