auto-claude: subtask-1-3 - Extract BreadcrumbJsonLd component
This commit is contained in:
+3
-3
@@ -3,7 +3,7 @@
|
||||
"spec": "032-split-large-jsonld-tsx-component-759-lines-into-se",
|
||||
"state": "building",
|
||||
"subtasks": {
|
||||
"completed": 1,
|
||||
"completed": 2,
|
||||
"total": 19,
|
||||
"in_progress": 1,
|
||||
"failed": 0
|
||||
@@ -18,8 +18,8 @@
|
||||
"max": 1
|
||||
},
|
||||
"session": {
|
||||
"number": 3,
|
||||
"number": 4,
|
||||
"started_at": "2026-01-25T06:23:19.101802"
|
||||
},
|
||||
"last_update": "2026-01-25T06:29:44.912319"
|
||||
"last_update": "2026-01-25T06:31:22.524141"
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { type Locale } from '@/i18n/config';
|
||||
|
||||
export function BreadcrumbJsonLd({
|
||||
items,
|
||||
locale,
|
||||
}: {
|
||||
items: { name: string; url: string }[];
|
||||
locale: Locale;
|
||||
}) {
|
||||
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://damjan-savic.com';
|
||||
|
||||
const schema = {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'BreadcrumbList',
|
||||
inLanguage: locale === 'de' ? 'de-DE' : locale === 'sr' ? 'sr-RS' : 'en-US',
|
||||
itemListElement: items.map((item, index) => ({
|
||||
'@type': 'ListItem',
|
||||
position: index + 1,
|
||||
name: item.name,
|
||||
item: item.url.startsWith('http') ? item.url : `${baseUrl}${item.url}`,
|
||||
})),
|
||||
};
|
||||
|
||||
return (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user