Erste brauchbare Version

This commit is contained in:
timg
2026-08-31 19:55:41 +02:00
parent 080c4d0f39
commit 892a4d4747
35 changed files with 7103 additions and 219 deletions
+29
View File
@@ -0,0 +1,29 @@
import Link from 'next/link';
import { getPreview } from '@/lib/preview';
import config from '@payload-config';
import { getPayload } from 'payload';
export default async function Page() {
const { isPreview, where } = await getPreview();
const payload = await getPayload({ config });
const posts = await payload.find({
collection: 'posts',
where,
draft: isPreview
});
return (
<main className="flex flex-col">
{posts.docs.map((post) => (
<Link
key={post.id}
className="border border-1 border-primary p-4 m-4"
href={`/post/${post.slug}`}
>
{post.title}
</Link>
))}
</main>
);
}