mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-06-17 19:43:30 +08:00
Sidebar link active conditions - needs to be the same page
This commit is contained in:
parent
9e6b7b22a9
commit
53f6778087
@ -60,7 +60,7 @@
|
|||||||
<ol class="menu" id="main-menu">
|
<ol class="menu" id="main-menu">
|
||||||
{{ $currentPage := . }}
|
{{ $currentPage := . }}
|
||||||
{{ range .Site.Menus.main }}
|
{{ range .Site.Menus.main }}
|
||||||
{{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
|
{{ $active := or (eq $currentPage.RelPermalink .URL) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
|
||||||
<li {{ if $active }} class='current' {{ end }}>
|
<li {{ if $active }} class='current' {{ end }}>
|
||||||
<a href='{{ .URL }}' {{ if eq .Params.newTab true }}target="_blank"{{ end }}>
|
<a href='{{ .URL }}' {{ if eq .Params.newTab true }}target="_blank"{{ end }}>
|
||||||
{{ $icon := default .Pre .Params.Icon }}
|
{{ $icon := default .Pre .Params.Icon }}
|
||||||
|
Loading…
Reference in New Issue
Block a user