Skip to content

Commit 54367cf

Browse files
KianNHdaisyfaithauma
authored andcommitted
[Docs Site] Ignore external_link entries when setting current sidebar entry (#22368)
1 parent 319531b commit 54367cf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/util/sidebar.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ function setSidebarCurrentEntry(
129129
): boolean {
130130
for (const entry of sidebar) {
131131
if (entry.type === "link") {
132+
if (entry.attrs["data-external-link"]) {
133+
continue;
134+
}
135+
132136
const href = entry.href;
133137

134138
// Compare with and without trailing slash
@@ -293,6 +297,9 @@ async function handleLink(link: Link): Promise<Link> {
293297
variant: "note",
294298
}
295299
: undefined,
300+
attrs: {
301+
"data-external-link": true,
302+
},
296303
};
297304
}
298305

0 commit comments

Comments
 (0)