File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,13 @@ async function handleGroup(group: Group): Promise<SidebarEntry> {
225225 }
226226
227227 const idx = group . entries . indexOf ( index ) ;
228+
229+ if ( idx === - 1 ) {
230+ throw new Error (
231+ `[Sidebar] Originally located ${ index . href } in ${ group . label } entries but unable to find it post-transform` ,
232+ ) ;
233+ }
234+
228235 const removed = group . entries . splice ( idx , 1 ) . at ( 0 ) as Link ;
229236
230237 removed . attrs = {
@@ -270,7 +277,7 @@ async function handleLink(link: Link): Promise<Link> {
270277 link . badge = inferBadgeVariant ( link . badge ) ;
271278 }
272279
273- if ( frontmatter . external_link ) {
280+ if ( frontmatter . external_link && ! frontmatter . sidebar . group ?. hideIndex ) {
274281 return {
275282 ...link ,
276283 label : link . label . concat ( rehypeExternalLinksOptions . content . value ) ,
You can’t perform that action at this time.
0 commit comments