import { constructMetadata } from "@/lib/seo";
import { getAllPosts } from "@/data/posts";
import { blogCollectionSchema, breadcrumbSchema } from "@/lib/schema";
import JsonLd from "@/components/seo/JsonLd";
import BlogList from "@/components/sections/blog/BlogList";

export const metadata = constructMetadata({
  title: "Blog",
  description: "Insights, guides and updates from the Cerkel team — building, launching and scaling software.",
  path: "/blog",
});

export default function BlogPage() {
  const posts = getAllPosts();

  const schema = [
    breadcrumbSchema([
      { name: "Home", path: "/" },
      { name: "Blog", path: "/blog" },
    ]),
    blogCollectionSchema(posts),
  ];

  return (
    <>
      <JsonLd schema={schema} />
      <BlogList posts={posts} />
    </>
  );
}
