diff options
author | Valentin Popov <valentin@popov.link> | 2025-06-10 17:17:48 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2025-06-10 17:17:48 +0300 |
commit | 9ebcd40f60ffa393a56db850b6a6d0cf15ef4211 (patch) | |
tree | 88fc3edb345165258dcd3db343ee312d6dff2842 /src/pages/blog/index.astro | |
parent | 4e8c17a6eadebf847e497752a6f0bda25cd29f49 (diff) | |
download | popov.link-9ebcd40f60ffa393a56db850b6a6d0cf15ef4211.tar.xz popov.link-9ebcd40f60ffa393a56db850b6a6d0cf15ef4211.zip |
feat: create PostElement component for blog post display
- Added a new PostElement component to render individual blog posts with title, publication date, and reading time.
- Updated the blog index page to utilize PostElement instead of PostSummary for improved post presentation.
Diffstat (limited to 'src/pages/blog/index.astro')
-rw-r--r-- | src/pages/blog/index.astro | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index 210a7a1..48d33e8 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -1,7 +1,7 @@ --- import { getCollection } from "astro:content"; import Layout from "../../layouts/BaseLayout.astro"; -import PostSummary from "../../components/PostSummary.astro"; +import PostElement from "../../components/PostElement.astro"; const posts = await getCollection("blog", ({ data }) => { return data.draft !== true; @@ -12,6 +12,8 @@ posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()); <Layout> <section style={{ "margin-top": "3rem" }}> - {posts.map((post) => <PostSummary post={post} />)} + <ul> + {posts.map((post) => <PostElement post={post} />)} + </ul> </section> </Layout> |