personal-website/src/components/SinglePostCard.astro
Cyril Šebek 7a71a66dc7
Enabled SSR with pre-renders
- Enable server output mode
- Pre-render for (almost) every .astro file
- Fixed custom middleware
2024-07-08 23:01:44 +02:00

40 lines
837 B
Plaintext

---
export const prerender = true;
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "./ui/card";
const { post } = Astro.props;
---
<div>
<a href={`${Astro.url.origin}/${Astro.currentLocale}/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>