feat: use readme description as the category description

This commit is contained in:
KirisameVanilla 2025-09-28 10:04:54 +08:00
parent c288efe1bb
commit 34c949d43f
No known key found for this signature in database
GPG Key ID: A68EE6C617D68238
1 changed files with 3 additions and 1 deletions

View File

@ -61,13 +61,15 @@ function CardCategory({item}) {
if (!href) {
return null;
}
const docId = href.substring(6) + 'README';
const doc = useDocById(docId ?? undefined);
return (
<CardLayout
className={item.className}
href={href}
icon="🗃️"
title={item.label}
description={item.description ?? categoryItemsPlural(item.items.length)}
description={item.description ?? doc.description ?? categoryItemsPlural(item.items.length)}
/>
);
}