personal-website/src/components/SinglePostCard.astro

38 lines
800 B
Plaintext
Raw Normal View History

---
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "./ui/card";
const { post, lang } = Astro.props;
---
<div>
<a href={`${Astro.url.origin}/${lang ? lang : "en"}/blog/${post.blog_slug}`}>
<Card>
<CardHeader>
<img
src={post.data.image.url}
alt={post.data.image.alt}
class="rounded-md"
/>
<span class="py-2"></span>
<CardTitle>{post.data.title}</CardTitle>
<CardDescription>
<p>
{post.data.author} • {
post.data.publishDate.toLocaleString(Astro.currentLocale)
}
</p>
</CardDescription>
</CardHeader>
<CardContent>
<p>{post.data.description}</p>
</CardContent>
</Card>
</a>
</div>