Highlight active menu entry
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Luca 2020-11-25 13:02:12 +01:00
parent 74dfb1baa2
commit 0e009975d9
3 changed files with 6 additions and 3 deletions

View File

@ -1,2 +1,4 @@
$background: #100e23;
$text-color: #ffffff;
$highlight: #05b9ec;

View File

@ -115,6 +115,7 @@ figure {
padding: 0.5em;
&.nav-link-active {
color: $highlight;
}
}

View File

@ -1,3 +1,4 @@
{{ $currentPage := . }}
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">
<head>
@ -20,7 +21,6 @@
{{ end }}
<hr>
{{ end }}
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<a class="nav-link{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} nav-link-active{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
@ -29,10 +29,10 @@
{{ block "main" . }}
{{ end }}
<footer>
{{ i18n "last_change" . }}: {{ .Lastmod }}
{{ i18n "last_change" . }}: {{ .Lastmod.Format "2006-01-02 15:04:05 -0700" }}
<nav class="nav">
{{ range .Site.Menus.footer }}
<a class="nav-link" href="{{ .URL }}">{{ .Name }}</a>
<a class="nav-link{{ if or ($currentPage.IsMenuCurrent "footer" .) ($currentPage.HasMenuCurrent "footer" .) }} nav-link-active{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</nav>
</footer>