From 62dd29e3cb47533654ae844816fea4ff4dc8c3b6 Mon Sep 17 00:00:00 2001 From: Matheo Guilbert Date: Tue, 5 May 2026 09:22:37 +0200 Subject: [PATCH] implementation of JSON-LD --- app/[locale]/blog/[slug]/page.tsx | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/app/[locale]/blog/[slug]/page.tsx b/app/[locale]/blog/[slug]/page.tsx index 2bca9a9..af83166 100644 --- a/app/[locale]/blog/[slug]/page.tsx +++ b/app/[locale]/blog/[slug]/page.tsx @@ -117,8 +117,47 @@ export default async function ArticlePage({ params }: props) { notFound(); } + const articleUrl = `${siteUrl}/${locale}/blog/${slug}`; + + const imageUrl = article.cover + ? article.cover.startsWith("http") + ? article.cover + : `${siteUrl}${article.cover}` + : `${siteUrl}/og-image.jpg`; + + const jsonLd = { + "@context": "https://schema.org", + "@type": "BlogPosting", + headline: article.title, + description: article.description, + image: imageUrl, + datePublished: article.date, + dateModified: article.date, + author: { + "@type": "Person", + name: "Mathéo Guilbert", + url: siteUrl, + }, + publisher: { + "@type": "Person", + name: "Mathéo Guilbert", + url: siteUrl, + }, + mainEntityOfPage: { + "@type": "WebPage", + "@id": articleUrl, + }, + }; + return (
+