auto-claude: subtask-1-4 - Extract WebPageJsonLd component

This commit is contained in:
2026-01-25 06:33:19 +01:00
parent 602ff99b2b
commit 34ac65c534
2 changed files with 42 additions and 3 deletions
+3 -3
View File
@@ -3,7 +3,7 @@
"spec": "032-split-large-jsonld-tsx-component-759-lines-into-se",
"state": "building",
"subtasks": {
"completed": 2,
"completed": 3,
"total": 19,
"in_progress": 1,
"failed": 0
@@ -18,8 +18,8 @@
"max": 1
},
"session": {
"number": 4,
"number": 5,
"started_at": "2026-01-25T06:23:19.101802"
},
"last_update": "2026-01-25T06:31:22.524141"
"last_update": "2026-01-25T06:32:33.169444"
}
@@ -0,0 +1,39 @@
import { type Locale } from '@/i18n/config';
export function WebPageJsonLd({
title,
description,
url,
locale,
}: {
title: string;
description: string;
url: string;
locale: Locale;
}) {
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://damjan-savic.com';
const schema = {
'@context': 'https://schema.org',
'@type': 'WebPage',
name: title,
description: description,
url: url.startsWith('http') ? url : `${baseUrl}${url}`,
inLanguage: locale === 'de' ? 'de-DE' : locale === 'sr' ? 'sr-RS' : 'en-US',
isPartOf: {
'@type': 'WebSite',
name: 'Damjan Savić',
url: baseUrl,
},
author: {
'@id': `${baseUrl}/#person`,
},
};
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
/>
);
}