fix: resolve html invalid nesting, english routing 404s, and nodemailer missing credentials
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 5s
Build & Deploy / 🧪 QA (push) Successful in 3m14s
Build & Deploy / 🏗️ Build (push) Failing after 2m43s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-02-27 12:55:24 +01:00
parent a5718c5013
commit 62f1e9a89c
4 changed files with 71 additions and 28 deletions

View File

@@ -49,11 +49,11 @@ const jsxConverters: JSXConverters = {
const startsWithDash = text.trimStart().startsWith('- ');
const prefix = startsWithDash ? null : parts.shift();
return (
<>
<div className="my-4">
{prefix && (
<span dangerouslySetInnerHTML={prefix.includes('<') ? { __html: prefix } : undefined}>
<div dangerouslySetInnerHTML={prefix.includes('<') ? { __html: prefix } : undefined}>
{!prefix.includes('<') ? prefix : undefined}
</span>
</div>
)}
<ul className="list-disc pl-6 my-4 space-y-2">
{parts.map((item: string, i: number) => {
@@ -64,7 +64,7 @@ const jsxConverters: JSXConverters = {
return <li key={i}>{cleanItem}</li>;
})}
</ul>
</>
</div>
);
}
@@ -118,10 +118,12 @@ const jsxConverters: JSXConverters = {
);
}
if (node.format === 1) return <strong>{text}</strong>;
if (node.format === 2) return <em>{text}</em>;
return <span>{text}</span>;
if (node.format === 1) return <strong key="bold">{text}</strong>;
if (node.format === 2) return <em key="italic">{text}</em>;
return <span key="text">{text}</span>;
},
// Use div instead of p for paragraphs to allow nested block elements (like the lists above)
paragraph: ({ children }: any) => <div className="mb-4 leading-relaxed">{children}</div>,
// Scale headings to prevent multiple H1s (H1 -> H2, etc)
h1: ({ children }: any) => <h2 className="text-3xl md:text-4xl font-bold my-6">{children}</h2>,
h2: ({ children }: any) => <h3 className="text-2xl md:text-3xl font-bold my-5">{children}</h3>,
@@ -170,10 +172,10 @@ const jsxConverters: JSXConverters = {
/>
),
technicalGrid: ({ node }: any) => (
<TechnicalGrid title={node.fields.title} items={node.fields.items} />
<TechnicalGrid title={node?.fields?.title} items={node?.fields?.items} />
),
'block-technicalGrid': ({ node }: any) => {
console.log('[PayloadRichText] Rendering block-technicalGrid:', node.fields.title);
if (!node?.fields) return null;
return <TechnicalGrid title={node.fields.title} items={node.fields.items} />;
},
highlightBox: ({ node }: any) => (
@@ -246,20 +248,23 @@ const jsxConverters: JSXConverters = {
{node.fields.title}
</SplitHeading>
),
productTabs: ({ node }: any) => (
<ProductTabs
technicalData={
<ProductTechnicalData
data={{
technicalItems: node.fields.technicalItems,
voltageTables: node.fields.voltageTables,
}}
/>
}
>
<></>
</ProductTabs>
),
productTabs: ({ node }: any) => {
if (!node?.fields) return null;
return (
<ProductTabs
technicalData={
<ProductTechnicalData
data={{
technicalItems: node.fields.technicalItems,
voltageTables: node.fields.voltageTables,
}}
/>
}
>
<></>
</ProductTabs>
);
},
'block-productTabs': ({ node }: any) => (
<ProductTabs
technicalData={

2
next-env.d.ts vendored
View File

@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@@ -393,6 +393,7 @@ const nextConfig = {
},
images: {
formats: ['image/webp'],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
remotePatterns: [
{
protocol: 'https',
@@ -402,6 +403,14 @@ const nextConfig = {
protocol: 'https',
hostname: '*.klz-cables.com',
},
{
protocol: 'http',
hostname: 'klz-cables.com',
},
{
protocol: 'http',
hostname: '*.klz-cables.com',
},
{
protocol: 'http',
hostname: 'klz.localhost',
@@ -427,6 +436,31 @@ const nextConfig = {
source: '/de/kontakt',
destination: '/de/contact',
},
// Safety rewrites for English locale using German slugs (legacy or content errors)
{
source: '/en/produkte',
destination: '/en/products',
},
{
source: '/en/produkte/:path*',
destination: '/en/products/:path*',
},
{
source: '/en/kontakt',
destination: '/en/contact',
},
{
source: '/en/impressum',
destination: '/en/legal-notice',
},
{
source: '/en/datenschutz',
destination: '/en/privacy-policy',
},
{
source: '/en/agbs',
destination: '/en/terms',
},
],
afterFiles: [],
fallback: [],

View File

@@ -86,10 +86,14 @@ export default buildConfig({
transportOptions: {
host: process.env.MAIL_HOST || 'smtp.eu.mailgun.org',
port: Number(process.env.MAIL_PORT) || 587,
auth: {
user: process.env.MAIL_USERNAME,
pass: process.env.MAIL_PASSWORD,
},
...(process.env.MAIL_USERNAME
? {
auth: {
user: process.env.MAIL_USERNAME,
pass: process.env.MAIL_PASSWORD,
},
}
: {}),
},
})
: undefined,