Skip to content

Commit 6a461a0

Browse files
committed
Highlight current menu item
1 parent 19e9e9e commit 6a461a0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

themes/opentermsarchive/assets/css/components/aside.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,7 @@
9494
}
9595
}
9696
}
97+
98+
.aside_item-current{
99+
background-color:var(--colorBlack200);
100+
}

themes/opentermsarchive/layouts/partials/aside.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<aside class="aside">
2-
{{ $currentPageTitle := .Title }}
32
{{ $currentPageSection := .Section }}
3+
{{ $currentPageRelPermalink := .RelPermalink }}
44

55
<nav class="aside_nav">
66
<ul>
7-
<li><a href="{{ .Site.Home.RelPermalink }}">{{ .Site.Home.LinkTitle }}</a></li>
7+
<li class="{{ if eq $currentPageRelPermalink .Site.Home.RelPermalink }}aside_item-current{{ end }}"><a href="{{ .Site.Home.RelPermalink }}">{{ .Site.Home.LinkTitle }}</a></li>
88
{{ range .Site.Sections.ByWeight }}
99
<li class="{{ if eq $currentPageSection .Section }}aside_item-current{{ end }}">
10-
<details>
10+
<details {{ if eq $currentPageSection .Section }}open{{ end }}>
1111
<summary><b>{{ .LinkTitle }}</b></summary>
1212
<ul>
1313
{{ range .RegularPages.ByWeight }}

0 commit comments

Comments
 (0)