Skip to content

Commit aca9212

Browse files
committed
Improve aside menu
1 parent b63f1bd commit aca9212

File tree

2 files changed

+33
-25
lines changed

2 files changed

+33
-25
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
padding-left:var(--mXS);
3232
}
3333

34+
.aside_subsubitems{
35+
padding-left:var(--mS);
36+
}
37+
3438
.aside_item-current{
3539
background-color:var(--colorBlack200);
3640
& > a,

themes/opentermsarchive/layouts/partials/aside.html

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,35 @@
33
{{ $currentPageSection := .Section }}
44
<nav class="aside_nav">
55
<ul class="aside_items">
6-
{{ range .Site.Pages.ByWeight }}
7-
{{ if eq .Kind slice "section" "page" "home" }}
8-
{{ if eq .Type "page" }}
9-
<li class="aside_item {{ if eq $currentPageTitle .Title }}aside_item-current{{ end }}">
10-
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
11-
{{ if eq $currentPageTitle .Title }}
12-
{{ .Page.TableOfContents }}
13-
{{ end }}
14-
</li>
15-
{{ end }}
16-
{{ if eq .Kind "section" }}
17-
<li class="aside_item {{ if eq $currentPageSection .Section }}aside_item-current{{ end }}"><span class="aside_item_section">{{ .Title }}</span>
18-
<ul class="aside_subitems">
19-
{{ range where .Pages "Section" .Section }}
20-
<li class="aside_subitem">
21-
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
22-
{{ if eq $currentPageTitle .Title }}
23-
{{ .Page.TableOfContents }}
24-
{{ end }}
25-
</li>
26-
{{ end }}
27-
</ul>
28-
</li>
29-
{{ end }}
30-
{{ end }}
6+
{{ range .Site.Sections.ByWeight }}
7+
<li class="aside_item {{ if eq $currentPageSection .Section }}aside_item-current{{ end }}">
8+
<a href="{{ .RelPermalink }}" class="aside_item_section">{{ .LinkTitle }}</a>
9+
<ul class="aside_subitems">
10+
{{ range .RegularPages.ByWeight }}
11+
<li class="aside_subitem">
12+
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
13+
</li>
14+
{{ end }}
15+
{{ range .Sections.ByWeight }}
16+
<li class="aside_subitem">
17+
<a href="{{ .RelPermalink }}" class="aside_item_section">{{ .LinkTitle }}</a>
18+
<ul class="aside_subsubitems">
19+
{{ range .RegularPages.ByWeight }}
20+
<li class="aside_subsubitem">
21+
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
22+
</li>
23+
{{ end }}
24+
</ul>
25+
</li>
26+
{{ end }}
27+
</ul>
28+
</li>
29+
{{ end }}
30+
31+
{{ range where .Site.RegularPages "Section" "" }}
32+
<li class="aside_item {{ if eq $currentPageTitle .Title }}aside_item-current{{ end }}">
33+
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
34+
</li>
3135
{{ end }}
3236
</ul>
3337
</nav>

0 commit comments

Comments
 (0)