This commit changes all project imports to use absolute paths instead of relative ones. In addition, the 'tsconfig.json' has been updated to recognize new paths, aiding in easier project navigation and improved readability. The implemented changes result in cleaner imports and a more comprehensible project structure.
38 lines
1.1 KiB
Text
38 lines
1.1 KiB
Text
---
|
|
// Import necessary modules and utilities
|
|
import { Image } from "astro:assets";
|
|
import { formatDate } from "@utils/utils";
|
|
import type { CollectionEntry } from "astro:content";
|
|
|
|
const { blogEntry } = Astro.props;
|
|
|
|
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"
|
|
href={`/blog/${blogEntry.slug}/`}
|
|
data-astro-prefetch
|
|
>
|
|
<div>
|
|
<Image
|
|
class="aspect-video rounded-xl"
|
|
src={blogEntry.data.cardImage}
|
|
alt={blogEntry.data.cardImageAlt}
|
|
draggable={"false"}
|
|
format={"avif"}
|
|
/>
|
|
<!-- The title of the blog post -->
|
|
<h3
|
|
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"
|
|
>
|
|
{blogEntry.data.title}
|
|
</h3>
|
|
<!-- The formatted publication date of the blog post -->
|
|
<p class="mt-2 text-sm text-neutral-600 dark:text-neutral-400">
|
|
{formatDate(blogEntry.data.pubDate)}
|
|
</p>
|
|
</div></a
|
|
>
|