2023-05-13 14:38:56 +00:00
|
|
|
---
|
2023-06-17 10:21:29 +00:00
|
|
|
import Layout from "@/layouts/Layout.astro";
|
|
|
|
import { getPosts } from "@/utils/payload";
|
2023-05-13 14:38:56 +00:00
|
|
|
|
2023-05-15 15:38:17 +00:00
|
|
|
const posts = await getPosts();
|
2023-05-13 14:38:56 +00:00
|
|
|
---
|
|
|
|
|
2023-05-17 09:56:36 +00:00
|
|
|
<Layout title="Astroad">
|
2023-08-14 16:33:01 +00:00
|
|
|
<main class="" >
|
|
|
|
<h1 transition:animate="fade">Astroad</h1>
|
2023-05-17 09:56:36 +00:00
|
|
|
<p class="mt-3 text-lg">
|
|
|
|
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.
|
|
|
|
<br />
|
2023-08-14 16:13:20 +00:00
|
|
|
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.
|
2023-05-17 09:56:36 +00:00
|
|
|
</p>
|
|
|
|
<h2 class="mt-6">Posts</h2>
|
2023-05-19 09:09:07 +00:00
|
|
|
<div class="flex gap-4 mt-3 flex-wrap">
|
2023-05-17 09:56:36 +00:00
|
|
|
{
|
|
|
|
posts.length > 0 ? (
|
2023-05-19 11:06:28 +00:00
|
|
|
posts.map((post) => (
|
2023-08-14 16:13:20 +00:00
|
|
|
<a href={`/posts/${post.id}/`}>
|
2023-05-17 09:56:36 +00:00
|
|
|
<article class="text-gray bg-gray-light px-5 py-3 rounded-md shadow-md w-64 text-center hover:-translate-y-1 transition-transform">
|
2023-08-14 16:33:01 +00:00
|
|
|
<h3 transition:name=`title-${post.id}`>{post.title}</h3>
|
2023-05-17 09:56:36 +00:00
|
|
|
{post.publishedDate && (
|
|
|
|
<p>
|
|
|
|
{new Date(post.publishedDate).toLocaleDateString("de-DE")}
|
|
|
|
</p>
|
|
|
|
)}
|
|
|
|
</article>
|
|
|
|
</a>
|
|
|
|
))
|
|
|
|
) : (
|
|
|
|
<p>Add Posts in Payloadcms</p>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</div>
|
2023-05-15 14:52:29 +00:00
|
|
|
</main>
|
2023-05-13 14:38:56 +00:00
|
|
|
</Layout>
|