diff --git a/src/app/(main)/blog/page.tsx b/src/app/(main)/blog/page.tsx index f616d55..9936842 100644 --- a/src/app/(main)/blog/page.tsx +++ b/src/app/(main)/blog/page.tsx @@ -2,22 +2,106 @@ import { BeforeFooterBlock } from "@/components/Blocks/BeforeFooter"; import { BlogCardItemSkeleton } from "@/components/Blogs/BlogCardItem"; import Blogs from "@/components/Blogs/Blogs"; import HeroOther from "@/components/HeroOther"; +import { getDefaultMetadata } from "@/utils/metadata"; import { sanitizePageNumber } from "@/utils/sanitize"; +import { Metadata } from "next"; +import { headers } from "next/headers"; import { Suspense } from "react"; -export const metadata = { - title: "Blog - Cochise Oncology", - description: "Blog - Cochise Oncology", -}; +const metaDesc = + "Explore the latest insights, news, and patient resources on the Cochise Oncology blog. Stay informed about cancer treatments, patient support services, and wellness tips. Read our expert articles today."; + +export async function generateMetadata(): Promise { + const metadata = await getDefaultMetadata(); + metadata.title = `Blog - ${metadata.openGraph?.siteName}`; + metadata.description = metaDesc; + + return metadata; +} export default async function BlogPage({ searchParams }: { searchParams?: Promise<{ page?: string; s?: string }> }) { const params = await searchParams; const paramsPage = params?.page; const paramsSearch = params?.s; const page = sanitizePageNumber(paramsPage); + const headersList = await headers(); + const mainUrl = headersList.get("x-main-url"); + const fullUrl = headersList.get("x-full-url"); + const siteName = headersList.get("x-site-name"); + + const jsonLd = { + "@context": "https://schema.org", + "@graph": [ + { + "@type": "WebPage", + "@id": fullUrl, + url: fullUrl, + name: `Blog - ${siteName}`, + isPartOf: { + "@id": `${mainUrl}/#website`, + }, + datePublished: "2024-07-18T16:42:14+00:00", + dateModified: "2025-02-27T01:20:38+00:00", + description: metaDesc, + breadcrumb: { + "@id": `${fullUrl}#breadcrumb`, + }, + inLanguage: "en-US", + potentialAction: [ + { + "@type": "ReadAction", + target: [fullUrl], + }, + ], + }, + { + "@type": "WebSite", + "@id": `${mainUrl}/#website`, + url: `${mainUrl}/`, + name: siteName, + description: "", + publisher: { + "@id": `${mainUrl}/#organization`, + }, + potentialAction: [ + { + "@type": "SearchAction", + target: { + "@type": "EntryPoint", + urlTemplate: `${mainUrl}/?s={search_term_string}`, + }, + "query-input": { + "@type": "PropertyValueSpecification", + valueRequired: true, + valueName: "search_term_string", + }, + }, + ], + inLanguage: "en-US", + }, + { + "@type": "Organization", + "@id": `${mainUrl}/#organization`, + name: siteName, + url: `${mainUrl}/`, + logo: { + "@type": "ImageObject", + inLanguage: "en-US", + "@id": `${mainUrl}/#/schema/logo/image/`, + url: `${mainUrl}/assets/images/logo-dark.webp`, + contentUrl: `${mainUrl}/assets/images/logo-dark.webp`, + caption: siteName, + }, + image: { + "@id": `${mainUrl}/#/schema/logo/image/`, + }, + }, + ], + }; return ( <> +