deploy
Some checks failed
Build & Deploy KLZ Cables / deploy (push) Has been cancelled

This commit is contained in:
2026-01-25 17:52:57 +01:00
parent 3b03572fb0
commit c04a134eca
4 changed files with 74 additions and 59 deletions

View File

@@ -1,43 +1,50 @@
import { Organization, WebSite, WithContext } from 'schema-dts';
import { Thing, WithContext } from 'schema-dts';
export default function JsonLd() {
const organizationJsonLd: WithContext<Organization> = {
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'KLZ Cables',
url: 'https://klz-cables.com',
logo: 'https://klz-cables.com/logo-blue.svg',
sameAs: [
'https://www.linkedin.com/company/klz-cables',
],
description: 'Premium Cable Solutions for Renewable Energy and Infrastructure.',
address: {
'@type': 'PostalAddress',
addressCountry: 'DE',
},
};
interface JsonLdProps {
id?: string;
data?: WithContext<Thing> | WithContext<Thing>[];
}
const websiteJsonLd: WithContext<WebSite> = {
'@context': 'https://schema.org',
'@type': 'WebSite',
name: 'KLZ Cables',
url: 'https://klz-cables.com',
potentialAction: {
'@type': 'SearchAction',
target: {
'@type': 'EntryPoint',
urlTemplate: 'https://klz-cables.com/search?q={search_term_string}',
export default function JsonLd({ id, data }: JsonLdProps) {
// If data is provided, use it. Otherwise, use the default Organization + WebSite schema.
const schemaData = data || [
{
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'KLZ Cables',
url: 'https://klz-cables.com',
logo: 'https://klz-cables.com/logo-blue.svg',
sameAs: [
'https://www.linkedin.com/company/klz-cables',
],
description: 'Premium Cable Solutions for Renewable Energy and Infrastructure.',
address: {
'@type': 'PostalAddress',
addressCountry: 'DE',
},
// @ts-ignore - schema-dts might not have this specific property but it's valid for Google
'query-input': 'required name=search_term_string',
} as any,
};
},
{
'@context': 'https://schema.org',
'@type': 'WebSite',
name: 'KLZ Cables',
url: 'https://klz-cables.com',
potentialAction: {
'@type': 'SearchAction',
target: {
'@type': 'EntryPoint',
urlTemplate: 'https://klz-cables.com/search?q={search_term_string}',
},
'query-input': 'required name=search_term_string',
},
}
];
return (
<script
id={id}
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify([organizationJsonLd, websiteJsonLd]),
__html: JSON.stringify(schemaData),
}}
/>
);