Skip to content

Commit 4db325c

Browse files
committed
fix index link order and remove debug log
1 parent 4a60f71 commit 4db325c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/util/sidebar.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,19 @@ async function handleLink(link: Link): Promise<Link> {
225225

226226
const frontmatter = entry.data;
227227
link.order = frontmatter.sidebar.order ?? Number.MAX_VALUE;
228+
link.isCurrent = false;
229+
230+
if (link.href.split("/").filter(Boolean).length === 1) {
231+
link.order = 0;
232+
}
228233

229234
if (link.badge) {
230235
link.badge = inferBadgeVariant(link.badge);
231236
}
232237

233238
if (frontmatter.external_link) {
234-
console.log(link);
235-
236239
return {
237240
...link,
238-
isCurrent: false,
239241
label: link.label.concat(rehypeExternalLinksOptions.content.value),
240242
href: frontmatter.external_link,
241243
badge: frontmatter.external_link.startsWith("/api")
@@ -247,8 +249,6 @@ async function handleLink(link: Link): Promise<Link> {
247249
};
248250
}
249251

250-
link.isCurrent = false;
251-
252252
return link;
253253
}
254254

0 commit comments

Comments
 (0)