diff options
Diffstat (limited to 'www-2/src/pages/index.astro')
| -rw-r--r-- | www-2/src/pages/index.astro | 19 |
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> |
