Skip to content

Commit dd58fb1

Browse files
committed
WIP improve menu
1 parent e656513 commit dd58fb1

File tree

2 files changed

+74
-47
lines changed

2 files changed

+74
-47
lines changed

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

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,61 @@
1414
}
1515

1616
.aside_nav {
17-
> ul > li > details > ul > li:last-child,
18-
> ul > li > details > ul > li:not(:last-child) > ul {
19-
margin-bottom: var(--mS);
20-
}
17+
padding:var(--pS) 0;
2118

2219
ul {
2320
color: var(--colorBlack600);
2421
display: flex;
22+
gap:var(--m2XS);
2523
flex-direction: column;
24+
padding:0 var(--pS);
25+
26+
span{
27+
font-weight: bold;
28+
border-top:1px solid var(--colorBlack200);
29+
padding-top:var(--pS);
30+
margin-top:var(--mS);
31+
}
32+
33+
& ul {
34+
padding:0;
35+
& span {
36+
border-top:none;
37+
padding-top:0;
38+
margin-top:0;
39+
font-weight: normal;
40+
}
41+
}
2642

2743
li {
2844
position: relative;
29-
border-bottom: 1px solid var(--colorBlack200);
30-
31-
&:last-child {
32-
border: none;
45+
display: flex;
46+
flex-direction: column;
47+
gap:var(--m3XS);
48+
49+
& li{
50+
51+
& li{
52+
padding:0 var(--pS);
53+
}
54+
3355
}
3456

3557
a {
58+
59+
60+
}
61+
62+
/* a {
3663
padding: var(--mXS) var(--mS);
3764
display: inline-block;
3865
width: 100%;
39-
}
66+
} */
4067

41-
.aside_item-current {
42-
color: var(--colorBlack800);
68+
.aside_item-current {
69+
/* color: var(--colorBlack800); */
4370

44-
&::before {
71+
/* &::before {
4572
content: '';
4673
position: absolute;
4774
left: 0;
@@ -51,9 +78,9 @@
5178
z-index: 1;
5279
top: var(--m2XS);
5380
bottom: var(--m2XS);
54-
}
81+
} */
5582

56-
&::after {
83+
/* &::after {
5784
content: '';
5885
position: absolute;
5986
background-color: var(--colorBlack200);
@@ -63,11 +90,11 @@
6390
right: var(--m2XS);
6491
top: var(--m2XS);
6592
bottom: var(--m2XS);
66-
}
93+
} */
6794
}
6895

6996
&.aside_item-current-section {
70-
&::before {
97+
/* &::before {
7198
content: '';
7299
position: absolute;
73100
left: 0;
@@ -76,9 +103,9 @@
76103
width: 1px;
77104
background-color: var(--colorPrimary);
78105
border-radius: 0;
79-
}
106+
} */
80107

81-
& .aside_item-current {
108+
/* & .aside_item-current {
82109
&::before {
83110
top: 2px;
84111
bottom: 2px;
@@ -89,10 +116,10 @@
89116
bottom: 0;
90117
right: var(--mXS);
91118
}
92-
}
119+
} */
93120
}
94121

95-
details {
122+
/* details {
96123
position: relative;
97124
98125
summary {
@@ -130,10 +157,10 @@
130157
131158
span {
132159
display: inline-block;
133-
}
160+
} */
134161
}
135162

136-
ul {
163+
/* ul {
137164
li {
138165
border: none;
139166
@@ -165,6 +192,6 @@
165192
}
166193
}
167194
}
168-
}
195+
} */
169196
}
170197
}

themes/opentermsarchive/layouts/partials/aside.html

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@
44

55
<nav class="aside_nav">
66
<ul>
7-
<li ><b><a class="{{ if eq $currentPageRelPermalink .Site.Home.RelPermalink }}aside_item-current{{ end }}" href="{{ .Site.Home.RelPermalink }}">{{ .Site.Home.LinkTitle }}</a></b></li>
7+
{{ range where .Site.Pages "Section" "" }}
8+
<li><a class="{{ if eq .RelPermalink .Site.Home.RelPermalink }}aside_item-current{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
9+
{{ end }}
810
{{ range .Site.Sections.ByWeight }}
911
<li class="{{ if eq $currentPageSection .Section }}aside_item-current-section{{ end }}">
10-
<details {{ if eq $currentPageSection .Section }}open{{ end }}>
11-
<summary><b>{{ .LinkTitle | markdownify }}</b> <i class="icon" data-lucide="chevron-down"></i></summary>
12-
<ul>
13-
{{ $allPages := .RegularPages.ByWeight | append .Sections.ByWeight }}
14-
{{ $allPages := sort $allPages "Weight" }}
15-
{{ range $allPages }}
16-
<li>
17-
{{ if .Content }}
18-
<a class="{{ if eq $currentPageRelPermalink .RelPermalink }}aside_item-current{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify }}</a>
19-
{{ else }}
20-
<span class="{{ if eq $currentPageRelPermalink .RelPermalink }}aside_item-current{{ end }}">{{ .LinkTitle | markdownify }}</span>
21-
{{ end }}
22-
{{ if .IsSection }}
23-
<ul>
24-
{{ range .RegularPages.ByWeight }}
25-
<li><a class="{{ if eq $currentPageRelPermalink .RelPermalink }}aside_item-current{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify }}</a></li>
26-
{{ end }}
27-
</ul>
28-
{{ end }}
29-
</li>
30-
{{ end }}
31-
</ul>
32-
</details>
12+
<span>{{ .LinkTitle | markdownify }} </span>
13+
<ul>
14+
{{ $allPages := .RegularPages.ByWeight | append .Sections.ByWeight }}
15+
{{ $allPages := sort $allPages "Weight" }}
16+
{{ range $allPages }}
17+
<li>
18+
{{ if .Content }}
19+
<a class="{{ if eq $currentPageRelPermalink .RelPermalink }}aside_item-current{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify }}</a>
20+
{{ else }}
21+
<span class="{{ if eq $currentPageRelPermalink .RelPermalink }}aside_item-current{{ end }}">{{ .LinkTitle | markdownify }}</span>
22+
{{ end }}
23+
{{ if .IsSection }}
24+
<ul>
25+
{{ range .RegularPages.ByWeight }}
26+
<li><a class="{{ if eq $currentPageRelPermalink .RelPermalink }}aside_item-current{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify }}</a></li>
27+
{{ end }}
28+
</ul>
29+
{{ end }}
30+
</li>
31+
{{ end }}
32+
</ul>
3333
</li>
3434
{{ end }}
3535
</ul>

0 commit comments

Comments
 (0)