All checks were successful
Build and Deploy Astro App / build_and_deploy (push) Successful in 49s
103 lines
1.9 KiB
Text
103 lines
1.9 KiB
Text
---
|
|
import type { Post } from "../types/global";
|
|
import { findImageByPath } from "../lib/findImage";
|
|
import { Image } from "astro:assets";
|
|
import { formatLocalizedDateString } from "../lib/formatDate";
|
|
|
|
interface Props {
|
|
post: Post;
|
|
url: string;
|
|
}
|
|
|
|
const { post, url } = Astro.props;
|
|
|
|
const img = findImageByPath(post.image.path);
|
|
const localeDate = formatLocalizedDateString(post.date)
|
|
---
|
|
|
|
<div class="wide-container">
|
|
<div class="image-col col rounded">
|
|
<a href={url}>
|
|
<Image src={img} alt={post.image.alt} layout="constrained" />
|
|
</a>
|
|
</div>
|
|
<div class="text-col col">
|
|
<a href={url} class="headline-link">
|
|
<h2 class="headline">{post.title}</h2>
|
|
</a>
|
|
<h7>{post.subtitle}</h7>
|
|
<div class="top-info">
|
|
<span>{localeDate}</span>
|
|
<span class="vertical-line"></span>
|
|
<span>Autor: {post.author}</span>
|
|
</div>
|
|
<p class="description">{post.description}</p>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.wide-container {
|
|
display: flex;
|
|
gap: 32px;
|
|
padding: 0 32px;
|
|
}
|
|
|
|
.col {
|
|
width: 50%;
|
|
box-sizing: border-box;
|
|
min-width: 0;
|
|
min-height: 0;
|
|
}
|
|
|
|
.text-col {
|
|
flex-direction: column;
|
|
justify-content: flex-start;
|
|
margin: 32px 0;
|
|
}
|
|
|
|
h2 {
|
|
margin: 0;
|
|
}
|
|
|
|
.image-col {
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.image-col img {
|
|
position: absolute;
|
|
inset: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
object-position: center;
|
|
}
|
|
|
|
.top-info {
|
|
justify-content: space-between;
|
|
margin: 16px 0;
|
|
font-size: 1.125rem;
|
|
color: lightslategray;
|
|
}
|
|
|
|
.vertical-line {
|
|
color: #789;
|
|
border-right-width: 2px;
|
|
margin-right: 16px;
|
|
}
|
|
|
|
@media only screen and (max-width: 800px) {
|
|
.wide-container {
|
|
flex-direction: column;
|
|
gap: 0;
|
|
}
|
|
|
|
.col {
|
|
width: 100%;
|
|
}
|
|
|
|
.image-col img {
|
|
position: static;
|
|
}
|
|
}
|
|
</style>
|