feat: use readme description as the category description
This commit is contained in:
parent
c288efe1bb
commit
34c949d43f
|
|
@ -61,13 +61,15 @@ function CardCategory({item}) {
|
||||||
if (!href) {
|
if (!href) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
const docId = href.substring(6) + 'README';
|
||||||
|
const doc = useDocById(docId ?? undefined);
|
||||||
return (
|
return (
|
||||||
<CardLayout
|
<CardLayout
|
||||||
className={item.className}
|
className={item.className}
|
||||||
href={href}
|
href={href}
|
||||||
icon="🗃️"
|
icon="🗃️"
|
||||||
title={item.label}
|
title={item.label}
|
||||||
description={item.description ?? categoryItemsPlural(item.items.length)}
|
description={item.description ?? doc.description ?? categoryItemsPlural(item.items.length)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue