aboutsummaryrefslogtreecommitdiff
path: root/www-2/src/pages/index.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/pages/index.astro
parent78e3e234877cb10ca1088df31e831b36fa4a12c0 (diff)
downloadcrupest-6d39cee75e7ef7c5e06d1a745a32224e11d68c37.tar.gz
crupest-6d39cee75e7ef7c5e06d1a745a32224e11d68c37.tar.bz2
crupest-6d39cee75e7ef7c5e06d1a745a32224e11d68c37.zip
HALF WORK!astro
Diffstat (limited to 'www-2/src/pages/index.astro')
-rw-r--r--www-2/src/pages/index.astro19
1 files changed, 5 insertions, 14 deletions
diff --git a/www-2/src/pages/index.astro b/www-2/src/pages/index.astro
index 4007037..c8687c4 100644
--- a/www-2/src/pages/index.astro
+++ b/www-2/src/pages/index.astro
@@ -1,16 +1,16 @@
---
-import { getCollection, render } from "astro:content";
+import { getCollection } from "astro:content";
import PageBase from "../layouts/PageBase.astro";
import Friend from "../components/Friend.astro";
-import ArticlePreview from "../components/ArticlePreview.astro";
+import ArticlePreviewList from "../components/ArticlePreviewList.astro";
const posts = (
- await getCollection("blogs", ({ id }) => id.startsWith("posts/"))
+ await getCollection("articles", ({ id }) => id.startsWith("posts/"))
).slice(0, 3);
---
-<PageBase>
+<PageBase title="crupest's home">
<img id="avatar" src="/avatar.png" alt="My avatar" width="80" height="80" />
<h1 id="title">Hello! This is <code>crupest</code> !</h1>
<hr />
@@ -38,16 +38,7 @@ const posts = (
<hr />
<section id="recent-posts">
<h2>Recent Posts <a class="mono-link" href="/posts">(all)</a></h2>
- {
- posts.map((post) => (
- <ArticlePreview
- title={post.data.title}
- date={post.data.date.toLocaleString()}
- url={"/posts/" + post.id}
- content=""
- />
- ))
- }
+ <ArticlePreviewList articles={posts} headerElement="h3" />
</section>
<hr />
<section>