Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/curttimson/hugo-theme-massively.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/partials/nav.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index e8237e2..b6ccdf1 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -1,11 +1,12 @@
<!-- Nav -->
{{ $data := index .Site.Data .Site.Language.Lang }}
+{{ $currentPage := .Page }}
<nav id="nav">
<ul class="links">
- <li class="active"><a href='{{ "/" | relLangURL }}'>{{ .Site.Title }}</a></li>
+ <li class="{{ if eq ($currentPage.RelPermalink) (`/`) }}active{{end}}"><a href='{{ "/" | relLangURL }}'>{{ .Site.Title }}</a></li>
{{- with $data.nav.items -}}
{{- range $i, $e := . -}}
- <li><a href='{{ .url | relLangURL }}'>{{- .title -}}</a></li>
+ <li class="{{ if eq ($currentPage.RelPermalink) (print .url `/`) }}active{{end}}"><a href='{{ .url | relLangURL }}'>{{- .title -}}</a></li>
{{- end -}}
{{- end -}}
{{ with $data.contactinfo }}