@@ -38,14 +38,16 @@ function useCategoryItemsPlural() {
3838function CardContainer ( {
3939 href,
4040 children,
41+ className,
4142} : {
4243 href : string ;
4344 children : ReactNode ;
45+ className ?: string ;
4446} ) : ReactNode {
4547 return (
4648 < Link
4749 href = { href }
48- className = { clsx ( 'card padding--lg' , styles . cardContainer ) } >
50+ className = { clsx ( 'card padding--lg' , styles . cardContainer , className ) } >
4951 { children }
5052 </ Link >
5153 ) ;
@@ -57,15 +59,17 @@ function CardLayout({
5759 title,
5860 description,
5961 customProps,
62+ className,
6063} : {
6164 href : string ;
6265 icon : ReactNode ;
6366 title : string ;
6467 description ?: string ;
6568 customProps : { [ key : string ] : unknown } | undefined ;
69+ className ?: string ;
6670} ) : ReactNode {
6771 return (
68- < CardContainer href = { href } >
72+ < CardContainer href = { href } className = { className } >
6973 < Heading
7074 as = "h3"
7175 className = { clsx ( 'text--truncate' , styles . cardTitle ) }
@@ -92,7 +96,7 @@ function CardLayout({
9296 ) ;
9397}
9498
95- function CardCategory ( { item} : { item : PropSidebarItemCategory } ) : ReactNode {
99+ function CardCategory ( { item, className } : { item : PropSidebarItemCategory , className ?: string } ) : ReactNode {
96100 const href = findFirstSidebarItemLink ( item ) ;
97101 const categoryItemsPlural = useCategoryItemsPlural ( ) ;
98102
@@ -109,11 +113,12 @@ function CardCategory({item}: {item: PropSidebarItemCategory}): ReactNode {
109113 // description={item.description ?? categoryItemsPlural(item.items.length)}
110114 description = { item . description }
111115 customProps = { item . customProps }
116+ className = { className }
112117 />
113118 ) ;
114119}
115120
116- function CardLink ( { item} : { item : PropSidebarItemLink } ) : ReactNode {
121+ function CardLink ( { item, className } : { item : PropSidebarItemLink , className ?: string } ) : ReactNode {
117122 const icon = isInternalUrl ( item . href ) ? '📄️' : '🔗' ;
118123 const doc = useDocById ( item . docId ?? undefined ) ;
119124 return (
@@ -123,16 +128,17 @@ function CardLink({item}: {item: PropSidebarItemLink}): ReactNode {
123128 title = { item . label }
124129 description = { item . description ?? doc ?. description }
125130 customProps = { item . customProps }
131+ className = { className }
126132 />
127133 ) ;
128134}
129135
130136export default function DocCard ( { item} : Props ) : ReactNode {
131137 switch ( item . type ) {
132138 case 'link' :
133- return < CardLink item = { item } /> ;
139+ return < CardLink item = { item } className = "exclude-from-search" /> ;
134140 case 'category' :
135- return < CardCategory item = { item } /> ;
141+ return < CardCategory item = { item } className = "exclude-from-search" /> ;
136142 default :
137143 throw new Error ( `unknown item type ${ JSON . stringify ( item ) } ` ) ;
138144 }
0 commit comments