feat(landing): add devlog section to homepage

- Display latest devlog entries on the homepage
- Show category badges, dates, commits, and read time
- Link to full devlog overview
- Responsive grid layout with hover effects

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-01-23 18:03:19 +01:00
parent 2596cb7540
commit 9f00a367cf

View file

@ -2,10 +2,33 @@
import Layout from '../layouts/Layout.astro';
import Footer from '../components/navigation/Footer.astro';
import { getLangFromUrl, useTranslations } from '../lib/i18n/config';
import { getCollection } from 'astro:content';
const lang = getLangFromUrl(Astro.url);
const t = useTranslations(lang);
// Get latest devlog posts
const devlogPosts = await getCollection('devlog');
const latestPosts = devlogPosts
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
.slice(0, 3);
const formatDate = (date: Date) => {
return new Intl.DateTimeFormat('de-DE', {
day: '2-digit',
month: 'short',
year: 'numeric',
}).format(date);
};
const categoryColors: Record<string, string> = {
release: 'from-green-500 to-emerald-500',
infrastructure: 'from-blue-500 to-cyan-500',
feature: 'from-purple-500 to-pink-500',
bugfix: 'from-orange-500 to-amber-500',
update: 'from-gray-500 to-slate-500',
};
// App-Daten für den Scroller
const apps = [
{
@ -388,6 +411,111 @@ const apps = [
</div>
</section>
<!-- Devlog Section -->
{
latestPosts.length > 0 && (
<section class="devlog-section">
<div class="devlog-overlay" />
<div class="devlog-container">
<div class="devlog-header">
<h2 class="devlog-main-title">
Aus dem <span class="gradient-text">Devlog</span>
</h2>
<p class="devlog-main-subtitle">
Einblicke in unsere Entwicklung - was wir bauen und warum
</p>
</div>
<div class="devlog-grid">
{latestPosts.map((post, index) => (
<a
href={`/devlog/${post.slug}`}
class={`devlog-card ${index === 0 ? 'devlog-featured' : ''}`}
>
<div class="devlog-card-inner">
<div class="devlog-meta">
<span
class={`devlog-category bg-gradient-to-r ${categoryColors[post.data.category] || categoryColors.update}`}
>
{post.data.category}
</span>
<span class="devlog-date">{formatDate(post.data.date)}</span>
</div>
<h3 class="devlog-title">{post.data.title}</h3>
<p class="devlog-excerpt">{post.data.description}</p>
{post.data.commits && (
<div class="devlog-stats">
<span class="devlog-stat">
<svg
class="devlog-stat-icon"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
/>
</svg>
{post.data.commits} Commits
</span>
{post.data.readTime && (
<span class="devlog-stat">
<svg
class="devlog-stat-icon"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
{post.data.readTime} min
</span>
)}
</div>
)}
<span class="devlog-link">
Weiterlesen
<svg class="devlog-arrow" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 5l7 7-7 7"
/>
</svg>
</span>
</div>
</a>
))}
</div>
<div class="devlog-cta">
<a href="/devlog" class="devlog-all-link">
Alle Einträge ansehen
<svg class="devlog-all-arrow" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M17 8l4 4m0 0l-4 4m4-4H3"
/>
</svg>
</a>
</div>
</div>
</section>
)
}
<!-- Footer -->
<Footer />
</Layout>
@ -1610,4 +1738,264 @@ const apps = [
grid-template-columns: 1fr;
}
}
/* ========================
DEVLOG SECTION
======================== */
.devlog-section {
position: relative;
background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
padding: calc(var(--grid-unit) * 4) 0;
overflow: hidden;
}
.devlog-overlay {
position: absolute;
inset: 0;
background:
radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
radial-gradient(circle at 80% 70%, rgba(37, 99, 235, 0.04) 0%, transparent 50%);
pointer-events: none;
}
.devlog-container {
position: relative;
max-width: 1400px;
margin: 0 auto;
padding: 0 calc(var(--grid-unit) * 2);
z-index: 10;
}
.devlog-header {
text-align: center;
margin-bottom: calc(var(--grid-unit) * 2.5);
}
.devlog-main-title {
font-size: clamp(2rem, 4vw, 3rem);
font-weight: 800;
color: #f8fafc;
margin: 0 0 calc(var(--grid-unit) * 0.5) 0;
line-height: 1.2;
letter-spacing: -0.02em;
}
.devlog-main-subtitle {
font-size: clamp(1rem, 2vw, 1.25rem);
color: #94a3b8;
margin: 0;
}
.devlog-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
gap: calc(var(--grid-unit) * 0.75);
max-width: 1200px;
margin: 0 auto;
}
.devlog-card {
text-decoration: none;
display: block;
transition: transform 0.3s ease;
}
.devlog-card:hover {
transform: translateY(-6px);
}
.devlog-featured .devlog-card-inner {
border-color: rgba(59, 130, 246, 0.3);
}
.devlog-card-inner {
height: 100%;
background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
border: 1px solid rgba(248, 250, 252, 0.1);
border-radius: 20px;
padding: calc(var(--grid-unit) * 1);
display: flex;
flex-direction: column;
gap: calc(var(--grid-unit) * 0.4);
backdrop-filter: blur(10px);
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.devlog-card-inner::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: none;
}
.devlog-card:hover .devlog-card-inner {
border-color: rgba(59, 130, 246, 0.4);
box-shadow:
0 15px 35px -10px rgba(0, 0, 0, 0.5),
0 0 0 1px rgba(59, 130, 246, 0.2);
}
.devlog-card:hover .devlog-card-inner::before {
opacity: 1;
}
.devlog-meta {
display: flex;
align-items: center;
gap: calc(var(--grid-unit) * 0.4);
flex-wrap: wrap;
}
.devlog-category {
font-size: 0.6875rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: white;
padding: 4px 10px;
border-radius: 20px;
}
.devlog-date {
font-size: 0.8125rem;
color: #94a3b8;
}
.devlog-title {
font-size: 1.375rem;
font-weight: 700;
color: #f8fafc;
margin: 0;
line-height: 1.3;
transition: color 0.3s ease;
}
.devlog-card:hover .devlog-title {
color: #60a5fa;
}
.devlog-excerpt {
font-size: 0.9375rem;
line-height: 1.6;
color: #cbd5e1;
margin: 0;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.devlog-stats {
display: flex;
gap: calc(var(--grid-unit) * 0.5);
margin-top: auto;
padding-top: calc(var(--grid-unit) * 0.25);
}
.devlog-stat {
display: flex;
align-items: center;
gap: 6px;
font-size: 0.8125rem;
color: #94a3b8;
}
.devlog-stat-icon {
width: 16px;
height: 16px;
}
.devlog-link {
display: flex;
align-items: center;
gap: 6px;
font-size: 0.875rem;
font-weight: 600;
color: #3b82f6;
margin-top: auto;
padding-top: calc(var(--grid-unit) * 0.25);
transition: gap 0.3s ease;
}
.devlog-card:hover .devlog-link {
gap: 10px;
}
.devlog-arrow {
width: 16px;
height: 16px;
transition: transform 0.3s ease;
}
.devlog-card:hover .devlog-arrow {
transform: translateX(4px);
}
.devlog-cta {
text-align: center;
margin-top: calc(var(--grid-unit) * 1.5);
}
.devlog-all-link {
display: inline-flex;
align-items: center;
gap: calc(var(--grid-unit) * 0.25);
font-size: 1rem;
font-weight: 600;
color: #f8fafc;
text-decoration: none;
padding: calc(var(--grid-unit) * 0.4) calc(var(--grid-unit) * 0.75);
border: 2px solid rgba(248, 250, 252, 0.2);
border-radius: 12px;
transition: all 0.3s ease;
}
.devlog-all-link:hover {
background: rgba(248, 250, 252, 0.1);
border-color: rgba(248, 250, 252, 0.3);
}
.devlog-all-arrow {
width: 20px;
height: 20px;
transition: transform 0.3s ease;
}
.devlog-all-link:hover .devlog-all-arrow {
transform: translateX(4px);
}
@media (max-width: 768px) {
.devlog-section {
padding: calc(var(--grid-unit) * 3) 0;
}
.devlog-grid {
grid-template-columns: 1fr;
}
.devlog-container {
padding: 0 calc(var(--grid-unit) * 1);
}
}
@media (max-width: 640px) {
.devlog-section {
padding: calc(var(--grid-unit) * 2) 0;
}
.devlog-card-inner {
padding: calc(var(--grid-unit) * 0.75);
}
.devlog-title {
font-size: 1.25rem;
}
}
</style>