diff --git a/src/components/SEO.astro b/src/components/SEO.astro index 3175672..79f3aaf 100644 --- a/src/components/SEO.astro +++ b/src/components/SEO.astro @@ -76,6 +76,22 @@ const personJsonLd = { ], }; +// Article JSON-LD (for blog posts / articles) +const articleJsonLd = + ogType === "article" && article + ? { + "@context": "https://schema.org", + "@type": "BlogPosting", + headline: title, + description, + image: imageUrl, + url: canonicalUrl, + inLanguage: locale, + ...(article.publishedTime && { datePublished: article.publishedTime }), + author: { "@id": `${siteUrl}/#person` }, + } + : null; + // WebSite JSON-LD (only on home pages) const websiteJsonLd = isHomePage ? { @@ -129,6 +145,11 @@ const websiteJsonLd = isHomePage