diff --git a/app/[locale]/[slug]/page.tsx b/app/[locale]/[slug]/page.tsx index f179af32f..7d5507bb9 100644 --- a/app/[locale]/[slug]/page.tsx +++ b/app/[locale]/[slug]/page.tsx @@ -1,4 +1,5 @@ import { notFound, redirect } from 'next/navigation'; +import { getImageProps } from 'next/image'; import { Container, Badge, Heading } from '@/components/ui'; import { getTranslations, setRequestLocale } from 'next-intl/server'; import { Metadata } from 'next'; @@ -54,6 +55,26 @@ const mdxComponents = { GrowthChart, DeepDrillAnimation, DataGridPulse, + ResponsiveImage: (props: any) => { + let src = props.src; + if (typeof src === 'string' && src.startsWith('/_next/image')) { + try { + const urlParam = new URLSearchParams(src.split('?')[1]).get('url'); + if (urlParam) src = decodeURIComponent(urlParam); + } catch (e) {} + } + const { props: { srcSet, src: finalSrc, sizes } } = getImageProps({ + src, + alt: props.alt || '', + width: 1920, + height: 1080, + sizes: '(max-width: 768px) 100vw, (max-width: 1200px) 75vw, 50vw', + quality: 80, + }); + return ( + + ); + }, // Standard HTML element mapping for consistent E-TIB typography h1: (props: any) => , // Hidden because Hero handles H1 h2: (props: any) => , diff --git a/app/[locale]/blog/[slug]/page.tsx b/app/[locale]/blog/[slug]/page.tsx index cbcac89cd..cf410581e 100644 --- a/app/[locale]/blog/[slug]/page.tsx +++ b/app/[locale]/blog/[slug]/page.tsx @@ -1,4 +1,5 @@ import { notFound, redirect } from 'next/navigation'; +import { getImageProps } from 'next/image'; import JsonLd from '@/components/JsonLd'; import { SITE_URL } from '@/lib/schema'; import { @@ -24,6 +25,26 @@ const mdxComponents = { h2: (props: any) => , h3: (props: any) => , h4: (props: any) => , + ResponsiveImage: (props: any) => { + let src = props.src; + if (typeof src === 'string' && src.startsWith('/_next/image')) { + try { + const urlParam = new URLSearchParams(src.split('?')[1]).get('url'); + if (urlParam) src = decodeURIComponent(urlParam); + } catch (e) {} + } + const { props: { srcSet, src: finalSrc, sizes } } = getImageProps({ + src, + alt: props.alt || '', + width: 1920, + height: 1080, + sizes: '(max-width: 768px) 100vw, (max-width: 1200px) 75vw, 50vw', + quality: 80, + }); + return ( + + ); + }, p: (props: any) =>

, ul: (props: any) =>

    , ol: (props: any) =>
      , diff --git a/app/[locale]/referenzen/page.tsx b/app/[locale]/referenzen/page.tsx index bbf3cd262..8cfdc3a6c 100644 --- a/app/[locale]/referenzen/page.tsx +++ b/app/[locale]/referenzen/page.tsx @@ -1,4 +1,5 @@ import { Container, Heading, Badge } from '@/components/ui'; +import { getImageProps } from 'next/image'; import { getTranslations, setRequestLocale } from 'next-intl/server'; import { Metadata } from 'next'; import { getAllReferences } from '@/lib/references'; @@ -40,6 +41,26 @@ const mdxComponents = { li: CustomLi, p: (props: any) =>

      , Heading, + ResponsiveImage: (props: any) => { + let src = props.src; + if (typeof src === 'string' && src.startsWith('/_next/image')) { + try { + const urlParam = new URLSearchParams(src.split('?')[1]).get('url'); + if (urlParam) src = decodeURIComponent(urlParam); + } catch (e) {} + } + const { props: { srcSet, src: finalSrc, sizes } } = getImageProps({ + src, + alt: props.alt || '', + width: 1920, + height: 1080, + sizes: '(max-width: 768px) 100vw, (max-width: 1200px) 75vw, 50vw', + quality: 80, + }); + return ( + + ); + }, }; interface PageProps {