diff --git a/astro/src/components/Post.astro b/astro/src/components/Post.astro
new file mode 100644
index 0000000..0ce9947
--- /dev/null
+++ b/astro/src/components/Post.astro
@@ -0,0 +1,38 @@
+---
+import { Image } from "@astrojs/image/components";
+
+const { post } = Astro.props;
+---
+
+
+
+
+
+
+
{post.title}
+ {post.publishedDate && (
+
+ {new Date(post.publishedDate).toLocaleDateString("de-DE")}
+
+ )}
+
+ {post.summary &&
+ {post.summary}
+
}
+
+
+
+
\ No newline at end of file
diff --git a/astro/src/components/Posts.astro b/astro/src/components/Posts.astro
new file mode 100644
index 0000000..7ea4b60
--- /dev/null
+++ b/astro/src/components/Posts.astro
@@ -0,0 +1,20 @@
+---
+import Post from "@/components/Post.astro"
+
+const { posts } = Astro.props;
+---
+
+
+
Posts
+
+ {
+ posts.length > 0 ? (
+ posts.map((post) => (
+
+ ))
+ ) : (
+ No posts available
+ )
+ }
+
+
diff --git a/astro/src/layouts/BaseLayout.astro b/astro/src/layouts/BaseLayout.astro
index 0dcc458..f85fe5f 100644
--- a/astro/src/layouts/BaseLayout.astro
+++ b/astro/src/layouts/BaseLayout.astro
@@ -31,7 +31,7 @@ import "@/global.css"
}
-
+
diff --git a/astro/src/layouts/ContentLayout.astro b/astro/src/layouts/ContentLayout.astro
index a69f623..e862702 100644
--- a/astro/src/layouts/ContentLayout.astro
+++ b/astro/src/layouts/ContentLayout.astro
@@ -8,8 +8,8 @@ const { title } = Astro.props;
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/astro/src/pages/index.astro b/astro/src/pages/index.astro
index 7e1a904..7aa3a32 100644
--- a/astro/src/pages/index.astro
+++ b/astro/src/pages/index.astro
@@ -1,4 +1,5 @@
---
+import Posts from "@/components/Posts.astro";
import ContentLayout from "@/layouts/ContentLayout.astro";
import { getPosts } from "@/utils/payload";
@@ -6,7 +7,7 @@ const posts = await getPosts();
---
-
+
Paystro
Paystro is a pre-configured setup for Astro and Payloadcms that makes it
@@ -20,26 +21,8 @@ const posts = await getPosts();
reverse proxy. This setup provides a secure and scalable production
environment for your website.
- Posts
-
-
+
+
diff --git a/payload/src/collections/Posts.ts b/payload/src/collections/Posts.ts
index e48cb5a..2019505 100644
--- a/payload/src/collections/Posts.ts
+++ b/payload/src/collections/Posts.ts
@@ -40,11 +40,25 @@ const Posts: CollectionConfig = {
type: "text",
required: true
},
+ {
+ name: "summary",
+ type: "text",
+ required: false
+ },
{
name: "publishedDate",
type: "date",
+ required: false,
+ admin: {
+ position: "sidebar",
+ }
+ },
+ {
+ name: "thumbnail",
+ type: "upload",
+ relationTo: "media",
+ required: true,
},
-
{
name: "content",
type: "richText",
@@ -67,6 +81,16 @@ const Posts: CollectionConfig = {
},
},
},
+ {
+ name: "author",
+ type: 'relationship',
+ relationTo: 'users',
+ hasMany: false,
+ required: false,
+ admin: {
+ position: "sidebar",
+ },
+ },
{
name: "status",
type: "select",