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

@@ -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

View File

@@ -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>
); );

View File

@@ -356,16 +356,14 @@ 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={{
__html: JSON.stringify({
'@context': 'https://schema.org', '@context': 'https://schema.org',
'@type': 'Product', '@type': 'Product',
name: product.frontmatter.title, name: product.frontmatter.title,
description: product.frontmatter.description, description: product.frontmatter.description,
sku: product.frontmatter.sku, sku: product.frontmatter.sku || product.slug.toUpperCase(),
image: product.frontmatter.images?.[0] ? `https://klz-cables.com${product.frontmatter.images[0]}` : undefined, image: product.frontmatter.images?.[0] ? `https://klz-cables.com${product.frontmatter.images[0]}` : undefined,
brand: { brand: {
'@type': 'Brand', '@type': 'Brand',
@@ -376,9 +374,19 @@ export default async function ProductPage({ params }: ProductPageProps) {
availability: 'https://schema.org/InStock', availability: 'https://schema.org/InStock',
priceCurrency: 'EUR', priceCurrency: 'EUR',
url: `https://klz-cables.com/${locale}/products/${slug.join('/')}`, url: `https://klz-cables.com/${locale}/products/${slug.join('/')}`,
itemCondition: 'https://schema.org/NewCondition',
}, },
}), 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>

View File

@@ -1,7 +1,14 @@
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;
data?: WithContext<Thing> | WithContext<Thing>[];
}
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', '@context': 'https://schema.org',
'@type': 'Organization', '@type': 'Organization',
name: 'KLZ Cables', name: 'KLZ Cables',
@@ -15,9 +22,8 @@ export default function JsonLd() {
'@type': 'PostalAddress', '@type': 'PostalAddress',
addressCountry: 'DE', addressCountry: 'DE',
}, },
}; },
{
const websiteJsonLd: WithContext<WebSite> = {
'@context': 'https://schema.org', '@context': 'https://schema.org',
'@type': 'WebSite', '@type': 'WebSite',
name: 'KLZ Cables', name: 'KLZ Cables',
@@ -28,16 +34,17 @@ export default function JsonLd() {
'@type': 'EntryPoint', '@type': 'EntryPoint',
urlTemplate: 'https://klz-cables.com/search?q={search_term_string}', urlTemplate: 'https://klz-cables.com/search?q={search_term_string}',
}, },
// @ts-ignore - schema-dts might not have this specific property but it's valid for Google
'query-input': 'required name=search_term_string', 'query-input': 'required name=search_term_string',
} as any, },
}; }
];
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),
}} }}
/> />
); );