mirror of
https://github.com/KazooTTT/kazoottt-blog-v2.git
synced 2025-06-24 19:21:31 +08:00
feat: Add summary card to note components
This commit is contained in:
@ -7,6 +7,7 @@ import ArticleContainer from "../ArticleContainer.astro";
|
|||||||
import ShareButtons from "../ShareButtons.astro";
|
import ShareButtons from "../ShareButtons.astro";
|
||||||
import ContentFooter from "../ContentFooter.astro";
|
import ContentFooter from "../ContentFooter.astro";
|
||||||
import { cn } from "@/utils/tailwind";
|
import { cn } from "@/utils/tailwind";
|
||||||
|
import Card from "../componentsBefore/Card.astro";
|
||||||
type Props<Tag extends HTMLTag> = Polymorphic<{ as: Tag }> & {
|
type Props<Tag extends HTMLTag> = Polymorphic<{ as: Tag }> & {
|
||||||
note: CollectionEntry<"note">;
|
note: CollectionEntry<"note">;
|
||||||
isPreview?: boolean | undefined;
|
isPreview?: boolean | undefined;
|
||||||
@ -77,6 +78,13 @@ if (modifiedDate && modifiedDate.toDateString() === date.toDateString()) {
|
|||||||
enableLineClamp && "line-clamp-4"
|
enableLineClamp && "line-clamp-4"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
{
|
||||||
|
isPreview && note.data.description && note.data.description.trim().length > 0 && (
|
||||||
|
<Card heading="摘要(由llm生成)" altText="摘要" class="my-4 w-full">
|
||||||
|
<div class="text-muted-foreground ml-4">{note.data.description}</div>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
<Content />
|
<Content />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user