From 6d39cee75e7ef7c5e06d1a745a32224e11d68c37 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 23 Jan 2026 23:16:45 +0800 Subject: HALF WORK! --- www-2/src/components/ArticlePreview.astro | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'www-2/src/components/ArticlePreview.astro') diff --git a/www-2/src/components/ArticlePreview.astro b/www-2/src/components/ArticlePreview.astro index 3301ad2..bce8b50 100644 --- a/www-2/src/components/ArticlePreview.astro +++ b/www-2/src/components/ArticlePreview.astro @@ -1,22 +1,25 @@ --- -interface Props { - title: string; - date: string; - url: string; - content: string; +import type { CollectionEntry } from "astro:content"; + +export type Props = { + article: CollectionEntry<"articles">; headerElement?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "h7"; -} +}; -const { title, date, url, content, headerElement = "h2" } = Astro.props; +const { + article: { + id, + data: { title, date }, + }, + headerElement = "h2", +} = Astro.props; const H = headerElement; ---
- {date} - {title} -

- {content} -

+ {date.toLocaleString()} + {title} +

aaa

... Read more

-- cgit v1.2.3