From cd6388c0d6febbe4ee32bf34161bed7cc8141939 Mon Sep 17 00:00:00 2001 From: KazooTTT Date: Fri, 14 Feb 2025 15:41:27 +0800 Subject: [PATCH] feat: Add summary card to note components --- src/components/note/Note.astro | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/note/Note.astro b/src/components/note/Note.astro index dc0289e..89fda86 100644 --- a/src/components/note/Note.astro +++ b/src/components/note/Note.astro @@ -7,6 +7,7 @@ import ArticleContainer from "../ArticleContainer.astro"; import ShareButtons from "../ShareButtons.astro"; import ContentFooter from "../ContentFooter.astro"; import { cn } from "@/utils/tailwind"; +import Card from "../componentsBefore/Card.astro"; type Props = Polymorphic<{ as: Tag }> & { note: CollectionEntry<"note">; isPreview?: boolean | undefined; @@ -77,6 +78,13 @@ if (modifiedDate && modifiedDate.toDateString() === date.toDateString()) { enableLineClamp && "line-clamp-4" )} > + { + isPreview && note.data.description && note.data.description.trim().length > 0 && ( + +
{note.data.description}
+
+ ) + }