layout redesign

This commit is contained in:
2026-05-09 10:18:26 +02:00
parent 4ff9579cff
commit 828bdce906
5 changed files with 256 additions and 83 deletions
+2 -21
View File
@@ -1,6 +1,6 @@
---
import Layout from '../layouts/Layout.astro';
import PostCard from '../components/PostCard.astro';
import PostList from '../components/react/PostList';
const API_URL = process.env.PUBLIC_API_URL || 'http://localhost:3000';
@@ -41,14 +41,6 @@ try {
error = `Could not connect to backend at ${API_URL}: ${e instanceof Error ? e.message : String(e)}${cause ? ' (Cause: ' + (cause.message || cause.code || JSON.stringify(cause)) + ')' : ''}`;
console.error(error);
}
function formatSlug(slug: string) {
if (!slug) return '';
return slug
.split('-')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
}
---
<Layout title="Home" description={siteConfig.welcome_subtitle}>
@@ -75,18 +67,7 @@ function formatSlug(slug: string) {
</div>
)}
{posts.map((post) => (
<PostCard
slug={post.slug}
date={post.date}
title={post.title}
excerpt={post.excerpt}
tags={post.tags}
draft={post.draft}
readingTime={post.reading_time}
formatSlug={formatSlug}
/>
))}
{posts.length > 0 && <PostList posts={posts} client:load />}
</div>
</div>
</Layout>