This commit is contained in:
@@ -6,7 +6,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: self-hosted
|
runs-on: infra-runner
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
@@ -336,14 +336,14 @@ export default async function BlogPost({ params: { locale, slug } }: BlogPostPro
|
|||||||
'@type': 'Organization',
|
'@type': 'Organization',
|
||||||
name: 'KLZ Cables',
|
name: 'KLZ Cables',
|
||||||
url: 'https://klz-cables.com',
|
url: 'https://klz-cables.com',
|
||||||
logo: 'https://klz-cables.com/logo.png'
|
logo: 'https://klz-cables.com/logo-blue.svg'
|
||||||
},
|
},
|
||||||
publisher: {
|
publisher: {
|
||||||
'@type': 'Organization',
|
'@type': 'Organization',
|
||||||
name: 'KLZ Cables',
|
name: 'KLZ Cables',
|
||||||
logo: {
|
logo: {
|
||||||
'@type': 'ImageObject',
|
'@type': 'ImageObject',
|
||||||
url: 'https://klz-cables.com/logo.png',
|
url: 'https://klz-cables.com/logo-blue.svg',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: post.frontmatter.excerpt,
|
description: post.frontmatter.excerpt,
|
||||||
@@ -354,7 +354,7 @@ export default async function BlogPost({ params: { locale, slug } }: BlogPostPro
|
|||||||
articleSection: post.frontmatter.category,
|
articleSection: post.frontmatter.category,
|
||||||
wordCount: post.content.split(/\s+/).length,
|
wordCount: post.content.split(/\s+/).length,
|
||||||
timeRequired: `PT${getReadingTime(post.content)}M`
|
timeRequired: `PT${getReadingTime(post.content)}M`
|
||||||
}}
|
} as any}
|
||||||
/>
|
/>
|
||||||
<JsonLd
|
<JsonLd
|
||||||
id={`breadcrumb-${slug}`}
|
id={`breadcrumb-${slug}`}
|
||||||
@@ -375,7 +375,7 @@ export default async function BlogPost({ params: { locale, slug } }: BlogPostPro
|
|||||||
item: `https://klz-cables.com/${locale}/blog/${slug}`,
|
item: `https://klz-cables.com/${locale}/blog/${slug}`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}}
|
} as any}
|
||||||
/>
|
/>
|
||||||
</article>
|
</article>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -356,29 +356,37 @@ export default async function ProductPage({ params }: ProductPageProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Structured Data */}
|
{/* Structured Data */}
|
||||||
<Script
|
<JsonLd
|
||||||
id={`jsonld-${product.slug}`}
|
id={`jsonld-${product.slug}`}
|
||||||
type="application/ld+json"
|
data={{
|
||||||
dangerouslySetInnerHTML={{
|
'@context': 'https://schema.org',
|
||||||
__html: JSON.stringify({
|
'@type': 'Product',
|
||||||
'@context': 'https://schema.org',
|
name: product.frontmatter.title,
|
||||||
'@type': 'Product',
|
description: product.frontmatter.description,
|
||||||
name: product.frontmatter.title,
|
sku: product.frontmatter.sku || product.slug.toUpperCase(),
|
||||||
description: product.frontmatter.description,
|
image: product.frontmatter.images?.[0] ? `https://klz-cables.com${product.frontmatter.images[0]}` : undefined,
|
||||||
sku: product.frontmatter.sku,
|
brand: {
|
||||||
image: product.frontmatter.images?.[0] ? `https://klz-cables.com${product.frontmatter.images[0]}` : undefined,
|
'@type': 'Brand',
|
||||||
brand: {
|
name: 'KLZ Cables',
|
||||||
'@type': 'Brand',
|
},
|
||||||
name: 'KLZ Cables',
|
offers: {
|
||||||
},
|
'@type': 'Offer',
|
||||||
offers: {
|
availability: 'https://schema.org/InStock',
|
||||||
'@type': 'Offer',
|
priceCurrency: 'EUR',
|
||||||
availability: 'https://schema.org/InStock',
|
url: `https://klz-cables.com/${locale}/products/${slug.join('/')}`,
|
||||||
priceCurrency: 'EUR',
|
itemCondition: 'https://schema.org/NewCondition',
|
||||||
url: `https://klz-cables.com/${locale}/products/${slug.join('/')}`,
|
},
|
||||||
},
|
additionalProperty: technicalItems.map((item: any) => ({
|
||||||
}),
|
'@type': 'PropertyValue',
|
||||||
}}
|
name: item.label,
|
||||||
|
value: item.value,
|
||||||
|
})),
|
||||||
|
category: product.frontmatter.categories.join(', '),
|
||||||
|
mainEntityOfPage: {
|
||||||
|
'@type': 'WebPage',
|
||||||
|
'@id': `https://klz-cables.com/${locale}/products/${slug.join('/')}`,
|
||||||
|
},
|
||||||
|
} as any}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,43 +1,50 @@
|
|||||||
import { Organization, WebSite, WithContext } from 'schema-dts';
|
import { Thing, WithContext } from 'schema-dts';
|
||||||
|
|
||||||
export default function JsonLd() {
|
interface JsonLdProps {
|
||||||
const organizationJsonLd: WithContext<Organization> = {
|
id?: string;
|
||||||
'@context': 'https://schema.org',
|
data?: WithContext<Thing> | WithContext<Thing>[];
|
||||||
'@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',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const websiteJsonLd: WithContext<WebSite> = {
|
export default function JsonLd({ id, data }: JsonLdProps) {
|
||||||
'@context': 'https://schema.org',
|
// If data is provided, use it. Otherwise, use the default Organization + WebSite schema.
|
||||||
'@type': 'WebSite',
|
const schemaData = data || [
|
||||||
name: 'KLZ Cables',
|
{
|
||||||
url: 'https://klz-cables.com',
|
'@context': 'https://schema.org',
|
||||||
potentialAction: {
|
'@type': 'Organization',
|
||||||
'@type': 'SearchAction',
|
name: 'KLZ Cables',
|
||||||
target: {
|
url: 'https://klz-cables.com',
|
||||||
'@type': 'EntryPoint',
|
logo: 'https://klz-cables.com/logo-blue.svg',
|
||||||
urlTemplate: 'https://klz-cables.com/search?q={search_term_string}',
|
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 (
|
return (
|
||||||
<script
|
<script
|
||||||
|
id={id}
|
||||||
type="application/ld+json"
|
type="application/ld+json"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: JSON.stringify([organizationJsonLd, websiteJsonLd]),
|
__html: JSON.stringify(schemaData),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user