Bluewaterblog/blog/src/components/PostPreviewSmall.astro
2026-06-27 14:48:09 +02:00

49 lines
959 B
Text

---
import { findImageByPath } from "../lib/findImage";
import type { Post } from "../types/global";
interface Props {
post: Post;
url: string;
}
const { post, url } = Astro.props;
const img = findImageByPath(post.image.path)
---
<a href={url} class="no-link-link">
<div class="frame rounded">
<img src={img.src} alt={post.image.alt} class="rounded" />
<h2 class="headline">{post.title}</h2>
<h7 class="subtitle">{post.subtitle}</h7>
<p class="description">{post.description}</p>
<div class="bottom-info">
<span>Author: {post.author}</span>
<span>{post.date}</span>
</div>
</div>
</a>
<style>
.frame {
flex: 220px; auto 0 0;
padding: 8px;
display: flex;
flex-direction: column;
border: 1px solid black;
width: 240px;
height: 100%;
}
img {
max-height: 220px;
}
.bottom-info {
display: flex;
justify-content: space-between;
margin-top: auto;
}
</style>