{post.title}
+ {post.publishedDate && ( ++ {new Date(post.publishedDate).toLocaleDateString("de-DE")} +
+ )} +diff --git a/astro/src/components/Content.astro b/astro/src/components/astro/Content.astro
similarity index 100%
rename from astro/src/components/Content.astro
rename to astro/src/components/astro/Content.astro
diff --git a/astro/src/components/[id].astro b/astro/src/components/astro/[id].astro
similarity index 100%
rename from astro/src/components/[id].astro
rename to astro/src/components/astro/[id].astro
diff --git a/astro/src/components/astro/posts.astro b/astro/src/components/astro/posts.astro
new file mode 100644
index 0000000..6b9a14a
--- /dev/null
+++ b/astro/src/components/astro/posts.astro
@@ -0,0 +1,25 @@
+---
+// const { posts } = Astro.props;
+import { getPosts } from "@/utils/payload";
+const posts = await getPosts();
+
+---
+
+ {
+ posts.length > 0 ? (
+ posts.map((post) => (
+
+
+ {new Date(post.publishedDate).toLocaleDateString("de-DE")}
+ {post.title}
+ {post.publishedDate && (
+
Add Posts in Payloadcms
+ ) + } diff --git a/astro/src/pages/index.astro b/astro/src/pages/index.astro index f92a141..6e3c2db 100644 --- a/astro/src/pages/index.astro +++ b/astro/src/pages/index.astro @@ -1,46 +1,12 @@ --- -import BaseLayout from "@/layouts/BaseLayout.astro"; -//import { getPosts } from "@/utils/payload"; -//const posts = await getPosts(); - import '../styles/global.css' +import BaseLayout from "@/layouts/BaseLayout.astro"; +import { App } from "@/components/App" --- - -
- Astroad is a pre-configured setup for Astro and Payloadcms that makes it
- easy to get started with building your website. With Astroad, you'll have
- a complete development environment that you can run locally using Docker.
- This makes it easy to test and develop your website before deploying it to
- a production environment.
-
- When you're ready to deploy the website on your own server, Astrotus
- comes with a production environment that requires the use of Traefik as a
- reverse proxy. This setup provides a secure and scalable production
- environment for your website.
-