Skip to content

Commit 4f81bca

Browse files
authored
Fix current page highlight in docs (#1380)
1 parent 6efce19 commit 4f81bca

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/src/components/LeftSidebar/LeftSidebar.astro

+9-6
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const url = {
9797
<a
9898
class="link"
9999
href={`${base}migration-guide`}
100-
aria-current={isCurrentPage("/migration-guide")}
100+
aria-current={isCurrentPage("migration-guide")}
101101
>
102102
Migrating
103103
</a>
@@ -120,7 +120,7 @@ const url = {
120120
<a
121121
class="link"
122122
href={`${base}openapi-fetch`}
123-
aria-current={isCurrentPage("/openapi-fetch")}
123+
aria-current={isCurrentPage("openapi-fetch")}
124124
>
125125
Introduction
126126
</a>
@@ -129,7 +129,7 @@ const url = {
129129
<a
130130
class="link"
131131
href={`${base}openapi-fetch/api`}
132-
aria-current={isCurrentPage("/openapi-fetch/api")}
132+
aria-current={isCurrentPage("openapi-fetch/api")}
133133
>
134134
API
135135
</a>
@@ -138,7 +138,7 @@ const url = {
138138
<a
139139
class="link"
140140
href={`${base}openapi-fetch/examples`}
141-
aria-current={isCurrentPage("/openapi-fetch/examples")}
141+
aria-current={isCurrentPage("openapi-fetch/examples")}
142142
>
143143
Examples
144144
</a>
@@ -147,7 +147,7 @@ const url = {
147147
<a
148148
class="link"
149149
href={`${base}openapi-fetch/about`}
150-
aria-current={isCurrentPage("/openapi-fetch/about")}
150+
aria-current={isCurrentPage("openapi-fetch/about")}
151151
>
152152
About
153153
</a>
@@ -165,7 +165,10 @@ const url = {
165165
});
166166

167167
document.getElementById("v6").addEventListener("change", (evt) => {
168-
if (window.location.pathname === "/migration-guide") {
168+
if (
169+
window.location.pathname === "/migration-guide" ||
170+
window.location.pathname.includes("/openapi-fetch")
171+
) {
169172
return; // no /v6 version
170173
}
171174
if (evt.target.checked) {

0 commit comments

Comments
 (0)