aboutsummaryrefslogtreecommitdiff
path: root/www-2/src/components/ArticlePreviewList.astro
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2026-01-23 23:16:45 +0800
committerYuqian Yang <crupest@crupest.life>2026-01-24 16:38:33 +0800
commit6d39cee75e7ef7c5e06d1a745a32224e11d68c37 (patch)
tree0f2646b569e8af6a2f464eb2755553eda0fe593b /www-2/src/components/ArticlePreviewList.astro
parent78e3e234877cb10ca1088df31e831b36fa4a12c0 (diff)
downloadcrupest-6d39cee75e7ef7c5e06d1a745a32224e11d68c37.tar.gz
crupest-6d39cee75e7ef7c5e06d1a745a32224e11d68c37.tar.bz2
crupest-6d39cee75e7ef7c5e06d1a745a32224e11d68c37.zip
HALF WORK!astro
Diffstat (limited to 'www-2/src/components/ArticlePreviewList.astro')
-rw-r--r--www-2/src/components/ArticlePreviewList.astro35
1 files changed, 35 insertions, 0 deletions
diff --git a/www-2/src/components/ArticlePreviewList.astro b/www-2/src/components/ArticlePreviewList.astro
new file mode 100644
index 0000000..abe54f2
--- /dev/null
+++ b/www-2/src/components/ArticlePreviewList.astro
@@ -0,0 +1,35 @@
+---
+import ArticlePreview, {
+ type Props as ArticlePreviewProps,
+} from "./ArticlePreview.astro";
+
+type Props = {
+ articles: ArticlePreviewProps["article"][];
+} & Omit<ArticlePreviewProps, "article">;
+
+export type { Props };
+
+const { articles, ...otherProps } = Astro.props;
+---
+
+{
+ articles.length > 0 && (
+ <ArticlePreview article={articles[0]} {...otherProps} />
+ )
+}
+
+{
+ articles.slice(1).map((a) => (
+ <>
+ <hr class="article-preview-hr" />
+ <ArticlePreview article={a} {...otherProps} />
+ </>
+ ))
+}
+
+<style>
+ hr.article-preview-hr {
+ border: none;
+ border-top: 1.5px dashed currentColor;
+ }
+</style>