--- import BaseLayout from "@/layouts/BaseLayout.astro"; import Content from "@/components/astro/Content.astro"; import type { Post } from "@/types"; import { getPost, getPosts } from "@/utils/payload"; export async function getStaticPaths() { const posts = await getPosts(); const paths = posts.map((post: Post) => ({ params: { id: post.id }, })); return paths; } const { id } = Astro.params; const post = id && (await getPost(id)); --- { post ? (
BACK

{post.title}

{post.content && }
) : (
404
) }