design works
This commit is contained in:
parent
fd081f1c6f
commit
b1349a7892
6 changed files with 78 additions and 52 deletions
|
|
@ -18,10 +18,9 @@ const { posts } = Astro.props;
|
|||
|
||||
<style>
|
||||
.post-grid {
|
||||
padding: 24px 24px;
|
||||
display: flex;
|
||||
gap: 32px;
|
||||
flex-wrap: wrap;
|
||||
display: grid;
|
||||
gap: 64px;
|
||||
width: 100%;
|
||||
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ const localeDate = formatLocalizedDateString(post.date);
|
|||
.wide-container {
|
||||
display: flex;
|
||||
gap: 32px;
|
||||
padding: 64px;
|
||||
padding: 48px 64px;
|
||||
width: 100%;
|
||||
background-image: linear-gradient(
|
||||
to bottom,
|
||||
|
|
@ -56,7 +56,7 @@ const localeDate = formatLocalizedDateString(post.date);
|
|||
}
|
||||
|
||||
.text-col {
|
||||
width: 40%;
|
||||
width: 50%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
|
@ -67,7 +67,7 @@ const localeDate = formatLocalizedDateString(post.date);
|
|||
}
|
||||
|
||||
.image-col {
|
||||
width: 60%;
|
||||
width: 50%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ const localeDate = formatLocalizedDateString(post.date);
|
|||
.image-col img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 250px;
|
||||
max-height: 300px;
|
||||
object-fit: cover;
|
||||
object-position: center;
|
||||
border: 2px solid white;
|
||||
|
|
|
|||
|
|
@ -9,44 +9,57 @@ interface Props {
|
|||
|
||||
const { post } = Astro.props;
|
||||
|
||||
const img = findImageByPath(post.image.path)
|
||||
const localeDate = formatLocalizedDateString(post.date)
|
||||
const img = findImageByPath(post.image.path);
|
||||
const localeDate = formatLocalizedDateString(post.date);
|
||||
---
|
||||
|
||||
<a href={`/blog/${post.slug}`} 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>Lesezeit: {post.time2read} min</p>
|
||||
<p class="description">{post.description}</p>
|
||||
<div class="bottom-info">
|
||||
<span>Author: {post.author}</span>
|
||||
<div id="info">
|
||||
<span>{localeDate}</span>
|
||||
<span> | </span>
|
||||
<span>Author: {post.author}</span>
|
||||
<span> | </span>
|
||||
<span>Lesezeit: {post.time2read} min</span>
|
||||
</div>
|
||||
<h1 class="headline">{post.title}</h1>
|
||||
<h2 class="subtitle">{post.subtitle}</h2>
|
||||
<p class="description">{post.description}</p>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.frame {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 200px;
|
||||
object-fit: cover;
|
||||
object-position: center;
|
||||
}
|
||||
|
||||
#info {
|
||||
padding: 8px 0 0 0;
|
||||
font-size: 1.2rem;
|
||||
* {
|
||||
color: grey;
|
||||
}
|
||||
}
|
||||
|
||||
.headline,
|
||||
.subtitle {
|
||||
color: var(--primary-color);
|
||||
font-weight: bold;
|
||||
margin: 8px 0 0 0;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.4;
|
||||
margin: 8px 0 0 0;
|
||||
}
|
||||
</style>
|
||||
</a>
|
||||
|
||||
<style>
|
||||
.frame {
|
||||
flex: 220px; auto 0 0;
|
||||
padding: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid black;
|
||||
width: 240px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 150px;
|
||||
object-fit: cover;
|
||||
object-position: center;
|
||||
}
|
||||
|
||||
.bottom-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: auto;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: Luxusurlaub in den Bergen - Hike & Bike im Wipptal
|
||||
subtitle: Das ist jetzt also unser Leben. Luxushotels, 3-Gänge-Menüs und die schönsten Umgebungen.
|
||||
title: Luxusurlaub in den Bergen
|
||||
subtitle: Hike & Bike im Wipptal
|
||||
description: Was könnte ein besser Kontrast zum Zelturlaub an der Ostsee sein, als eine Woche in einem luxuriösen Hotel, mitten in den Alpen? Und wenn ihr jetzt denkt, dass wir unsere Abfindung verschleudern...das ganze hat uns nur 80€ p.P. gekostet ;). Wie das funktioniert erfahrt ihr im Artikel.
|
||||
introduction: Was könnte ein besser Kontrast zum Zelturlaub an der Ostsee sein, als eine Woche in einem luxuriösen Hotel, mitten in den Alpen? Und wenn ihr jetzt denkt, dass wir unsere Abfindung verschleudern...das ganze hat uns nur 80€ p.P. gekostet ;) Wie das funktioniert erfahrt ihr im Artikel.
|
||||
image:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "\"Habt ihr jetzt schon ein Boot?\""
|
||||
subtitle: Von uns, vom Boot, von euch
|
||||
title: Die Frage der Fragen
|
||||
subtitle: "\"Habt ihr jetzt schon ein Boot?\""
|
||||
description: "Die titelgebende Frage haben wir in den letzten Tagen unglaublich oft gehört. Deshalb möchten wir euch zeigen, was für uns in nächster Zeit ansteht. Anfangen will ich in der Vergangenheit und Enden in der Zukunft..."
|
||||
introduction: Die titelgebende Frage haben wir in den letzten Tagen unglaublich oft gehört. Deshalb möchten wir euch zeigen, was für uns in nächster Zeit ansteht. Anfangen will ich in der Vergangenheit und enden in der Zukunft. In einem nächsten Artikel kommen wir sicher nochmal 'Zurück in die Zukunft' und beschreiben, was auf den zukünftigen Etappen passiert ist. Jetzt muss ich aber erst mal los. Das Boarding für den Flug nach Sofia beginnt!
|
||||
image:
|
||||
|
|
|
|||
|
|
@ -4,17 +4,31 @@ import PostPreviewLarge from "../components/PostPreviewLarge.astro";
|
|||
import PostGrid from "../components/PostGrid.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
const allPostsSorted = (await getCollection('posts')).sort(
|
||||
(postA, postB) =>
|
||||
postB.data.date.getTime() - postA.data.date.getTime()
|
||||
const allPostsSorted = (await getCollection("posts")).sort(
|
||||
(postA, postB) => postB.data.date.getTime() - postA.data.date.getTime(),
|
||||
);
|
||||
|
||||
const [mostRecentPost, ...sortedPosts] = allPostsSorted;
|
||||
---
|
||||
|
||||
<Main>
|
||||
<PostPreviewLarge
|
||||
post={mostRecentPost.data}
|
||||
/>
|
||||
<PostGrid posts={sortedPosts} />
|
||||
<PostPreviewLarge post={mostRecentPost.data} />
|
||||
<div id="last-articles">
|
||||
<h2>Letzte Artikel</h2>
|
||||
<PostGrid posts={sortedPosts} />
|
||||
</div>
|
||||
</Main>
|
||||
|
||||
<style>
|
||||
#last-articles {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
padding: 0 64px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 24px 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue