diff --git a/app/blog/[slug]/page.tsx b/app/blog/[slug]/page.tsx index 413c225..fe98535 100644 --- a/app/blog/[slug]/page.tsx +++ b/app/blog/[slug]/page.tsx @@ -78,6 +78,14 @@ export default async function BlogPost({ params }: BlogPostProps) { const title = metadata.title; const description = metadata.description || `${title} — an engineer's take on building real software. From CyberWorld Builders.`; + // Schema image must be an absolute URL — relative paths fail structured-data validation. + const toAbsoluteUrl = (path?: string) => + !path ? null : path.startsWith('http') ? path : `https://cyberworldbuilders.com${path}`; + const schemaImageUrl = + toAbsoluteUrl(metadata.socialImage) || + toAbsoluteUrl(metadata.headerImage) || + 'https://cyberworldbuilders.com/images/logo.png'; + // Build allPosts list for related posts and navigation const allPostEntries = getAllPosts(); const allPosts = allPostEntries.map(p => ({ @@ -153,14 +161,12 @@ export default async function BlogPost({ params }: BlogPostProps) { {new Date(metadata.publishedDate).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })}

- {metadata.modifiedDate && metadata.modifiedDate !== metadata.publishedDate && ( -

- Updated{' '} - -

- )} +

+ Last updated{' '} + +

@@ -174,7 +180,12 @@ export default async function BlogPost({ params }: BlogPostProps) { "@type": "BlogPosting", headline: title, description, - image: metadata.socialImage || "https://cyberworldbuilders.com/images/logo.png", + image: { + "@type": "ImageObject", + url: schemaImageUrl, + width: 1200, + height: 630, + }, author: { "@type": "Person", name: "Jay Long", diff --git a/app/blog/page.tsx b/app/blog/page.tsx index f9c15d4..4835ff3 100644 --- a/app/blog/page.tsx +++ b/app/blog/page.tsx @@ -176,13 +176,14 @@ export default async function BlogIndex({ searchParams }: BlogIndexProps) { )} - {/* CollectionPage Schema with freshness signals */} + {/* Blog schema with embedded BlogPosting entries — gives crawlers explicit + BlogPosting markup on the listing page in addition to per-post pages. */}