fix active navbar tab
This commit is contained in:
parent
1bb99acfe6
commit
56f1f8c12f
|
@ -12,14 +12,14 @@ category = "category"
|
||||||
[menu]
|
[menu]
|
||||||
|
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
identifier = "home"
|
identifier = ""
|
||||||
pre = "<i class='fa fa-home' aria-hidden='true'></i>"
|
pre = "<i class='fa fa-home' aria-hidden='true'></i>"
|
||||||
name = "Home"
|
name = "Home"
|
||||||
url = "/"
|
url = "/"
|
||||||
weight = 10
|
weight = 10
|
||||||
|
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
identifier = "experience"
|
identifier = "work"
|
||||||
pre = "<i class='fa fa-briefcase' aria-hidden='true'></i>"
|
pre = "<i class='fa fa-briefcase' aria-hidden='true'></i>"
|
||||||
name = "Work"
|
name = "Work"
|
||||||
url = "/work/"
|
url = "/work/"
|
||||||
|
|
|
@ -6,16 +6,19 @@
|
||||||
</a>
|
</a>
|
||||||
<nav class="site-nav">
|
<nav class="site-nav">
|
||||||
<ul>
|
<ul>
|
||||||
{{- $currentPage := . -}}
|
{{ $currentPage := . }}
|
||||||
{{ range .Site.Menus.main -}}
|
{{ range .Site.Menus.main }}
|
||||||
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
<li class='
|
||||||
|
{{ if or ($currentPage.IsMenuCurrent "main" .) (eq $currentPage.Section .Identifier) }}
|
||||||
|
active
|
||||||
|
{{ end }}'>
|
||||||
<a href="{{ .URL | absLangURL }}">
|
<a href="{{ .URL | absLangURL }}">
|
||||||
{{ .Pre }}
|
{{ .Pre }}
|
||||||
<span>{{ .Name }}</span>
|
<span>{{ .Name }}</span>
|
||||||
{{ .Post }}
|
{{ .Post }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{- end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ partial "i18nlist.html" . }}
|
{{ partial "i18nlist.html" . }}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Reference in a new issue