From 534a5644bfe92628bfa37e534da6dd79cdaa191c Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Fri, 13 Mar 2026 13:39:16 +0100 Subject: [PATCH] perf/a11y: replace raw img tags, fix alt text, aria-hidden, avif/webp --- next.config.js | 4 ++++ src/blocks/FDHeroBlock/Component.tsx | 2 +- src/blocks/FDLinkCardsBlock/Component.tsx | 1 + src/blocks/FDLocationsGridBlock/Component.tsx | 12 ++++++++---- src/blocks/FDPartnersLogosBlock/Component.tsx | 9 ++++++--- src/components/FDImage.tsx | 7 ++++++- tsconfig.tsbuildinfo | 2 +- 7 files changed, 27 insertions(+), 10 deletions(-) diff --git a/next.config.js b/next.config.js index e283882..1b5ba4f 100644 --- a/next.config.js +++ b/next.config.js @@ -77,6 +77,8 @@ const nextConfig = { cpus: 1, }, images: { + formats: ['image/avif', 'image/webp'], + minimumCacheTTL: 3600, remotePatterns: [ ...[NEXT_PUBLIC_SERVER_URL].map((item) => { const url = new URL(item) @@ -85,6 +87,8 @@ const nextConfig = { protocol: url.protocol.replace(':', ''), } }), + { hostname: 'img.youtube.com', protocol: 'https' }, + { hostname: 'i.vimeocdn.com', protocol: 'https' }, ], }, webpack: (webpackConfig) => { diff --git a/src/blocks/FDHeroBlock/Component.tsx b/src/blocks/FDHeroBlock/Component.tsx index b65e9ca..ca540f7 100644 --- a/src/blocks/FDHeroBlock/Component.tsx +++ b/src/blocks/FDHeroBlock/Component.tsx @@ -72,7 +72,7 @@ export const FDHeroBlockComponent: React.FC = ({ priority className="absolute inset-0 w-full h-full object-cover" sizes="100vw" - fallbackAlt="" + fallbackAlt={heading || ''} />