2024-02-18 00:55:43 +04:00
|
|
|
---
|
2024-02-18 07:39:17 +04:00
|
|
|
// Import necessary modules and utilities
|
2024-02-18 00:55:43 +04:00
|
|
|
import { Image } from "astro:assets";
|
2024-04-17 18:25:49 +04:00
|
|
|
import { formatDate } from "@utils/utils";
|
2024-02-18 00:55:43 +04:00
|
|
|
import type { CollectionEntry } from "astro:content";
|
2024-02-22 21:59:24 +04:00
|
|
|
|
2024-02-18 00:55:43 +04:00
|
|
|
const { blogEntry } = Astro.props;
|
2024-02-22 21:59:24 +04:00
|
|
|
|
2024-02-18 00:55:43 +04:00
|
|
|
interface Props {
|
|
|
|
|
blogEntry: CollectionEntry<"blog">;
|
|
|
|
|
}
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
<a
|
|
|
|
|
class="group block rounded-xl outline-none ring-zinc-500 transition duration-300 focus-visible:ring dark:ring-zinc-200 dark:focus:outline-none"
|
2024-02-18 23:16:41 +04:00
|
|
|
href={`/blog/${blogEntry.slug}/`}
|
|
|
|
|
data-astro-prefetch
|
2024-02-18 00:55:43 +04:00
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<Image
|
|
|
|
|
class="aspect-video rounded-xl"
|
|
|
|
|
src={blogEntry.data.cardImage}
|
|
|
|
|
alt={blogEntry.data.cardImageAlt}
|
|
|
|
|
draggable={"false"}
|
|
|
|
|
format={"avif"}
|
|
|
|
|
/>
|
2024-02-18 07:39:17 +04:00
|
|
|
<!-- The title of the blog post -->
|
2024-02-18 00:55:43 +04:00
|
|
|
<h3
|
2024-04-07 18:23:16 +04:00
|
|
|
class="mt-2 text-balance text-lg font-medium text-neutral-800 group-hover:text-orange-400 dark:text-neutral-300 dark:group-hover:text-neutral-50"
|
2024-02-18 00:55:43 +04:00
|
|
|
>
|
|
|
|
|
{blogEntry.data.title}
|
|
|
|
|
</h3>
|
2024-02-18 07:39:17 +04:00
|
|
|
<!-- The formatted publication date of the blog post -->
|
2024-02-18 00:55:43 +04:00
|
|
|
<p class="mt-2 text-sm text-neutral-600 dark:text-neutral-400">
|
|
|
|
|
{formatDate(blogEntry.data.pubDate)}
|
|
|
|
|
</p>
|
|
|
|
|
</div></a
|
|
|
|
|
>
|