import React, { Suspense } from "react"; import type { Metadata } from "next"; import Heading from "../components/reuseableUI/heading"; import Breadcrumb from "../components/reuseableUI/breadcrumb"; import BlogList from "../components/blog/BlogList"; import { fetchBlogPages } from "@/graphql/queries/getBlogs"; import { getStoreName } from "@/app/utils/branding"; import { generateCollectionPageSchema, generateBreadcrumbSchema, } from "@/lib/schema"; const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "http://localhost:3000"; const storeName = getStoreName(); const title = `Blog | ${storeName}`; const description = "Read the latest articles, guides, and tips."; const canonicalUrl = `${baseUrl.replace(/\/$/, "")}/blog`; const ogImageUrl = `${baseUrl.replace(/\/$/, "")}/og-image.png`; export const metadata: Metadata = { title, description, alternates: { canonical: canonicalUrl, }, openGraph: { title, description, type: "website", url: canonicalUrl, siteName: storeName, images: [ { url: ogImageUrl, width: 1200, height: 630, alt: `${storeName} - Blog`, }, ], }, twitter: { card: "summary_large_image", title, description, images: [ogImageUrl], }, }; export default async function BlogPage() { // Fetch blog posts from CMS const blogs = await fetchBlogPages(); // Generate schema.org structured data const collectionSchema = generateCollectionPageSchema( "Blog", "Read our latest articles, news, and insights about our products and services.", "/blog" ); const breadcrumbSchema = generateBreadcrumbSchema([ { name: "Home", url: "/" }, { name: "Blog", url: "/blog" }, ]); return (
{/* Schema.org structured data */}