From 9ebcd40f60ffa393a56db850b6a6d0cf15ef4211 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 10 Jun 2025 14:17:48 +0000 Subject: 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. --- src/components/PostElement.astro | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/components/PostElement.astro (limited to 'src/components/PostElement.astro') diff --git a/src/components/PostElement.astro b/src/components/PostElement.astro new file mode 100644 index 0000000..703189e --- /dev/null +++ b/src/components/PostElement.astro @@ -0,0 +1,32 @@ +--- +import { type CollectionEntry } from "astro:content"; +import dayjs from "dayjs"; + +type Props = { + readonly post: CollectionEntry<"blog">; +}; + +const { post } = Astro.props; +const { remarkPluginFrontmatter } = await post.render(); +const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"); +--- + + + +
  • + {post.data.title} +
    + + + + {remarkPluginFrontmatter.minutesRead} + +
    +
  • -- cgit v1.2.3