From 77d7833cf4209c63f7b18738f0a7ed619607cb0d Mon Sep 17 00:00:00 2001 From: MaryWylde Date: Wed, 5 Aug 2026 14:52:30 +0200 Subject: [PATCH 1/2] fix(seo): give Ahrefs-flagged images real alt text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ahrefs counts a decorative alt="" as a missing alt attribute, so the cookie close button, the /uxcp country flags and the longevity environment icons showed up across ~90 pages in the audit. Alt text is derived from content already on the page — the country name and the Strapi item name — so it stays correct and localized as the content changes. Co-Authored-By: Claude Opus 4.7 --- src/components/Box/Box.tsx | 2 +- .../EnvironmentSubSection/EnvironmentSubSection.tsx | 2 +- .../components/_uxcp/CountryBiasMap/BiasPanel/BiasPanel.tsx | 1 + .../_uxcp/CountryBiasMap/CountryList/CountryList.tsx | 2 +- .../_uxcp/CountryBiasMap/CountryMap/CountryMap.tsx | 6 +++++- .../components/_uxcp/CountryBiasMap/FlagImage/FlagImage.tsx | 4 +++- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/Box/Box.tsx b/src/components/Box/Box.tsx index 2d1ced28..defd6825 100644 --- a/src/components/Box/Box.tsx +++ b/src/components/Box/Box.tsx @@ -38,7 +38,7 @@ const Box: FC = ({ setIsSeen }) => { > = ({ })} >
- {''} + {name} {name}

diff --git a/src/uxcore/components/_uxcp/CountryBiasMap/BiasPanel/BiasPanel.tsx b/src/uxcore/components/_uxcp/CountryBiasMap/BiasPanel/BiasPanel.tsx index df77c664..bb23c4f2 100644 --- a/src/uxcore/components/_uxcp/CountryBiasMap/BiasPanel/BiasPanel.tsx +++ b/src/uxcore/components/_uxcp/CountryBiasMap/BiasPanel/BiasPanel.tsx @@ -123,6 +123,7 @@ const BiasPanel = forwardRef(
diff --git a/src/uxcore/components/_uxcp/CountryBiasMap/CountryList/CountryList.tsx b/src/uxcore/components/_uxcp/CountryBiasMap/CountryList/CountryList.tsx index 8f9ffb59..43b1ae9d 100644 --- a/src/uxcore/components/_uxcp/CountryBiasMap/CountryList/CountryList.tsx +++ b/src/uxcore/components/_uxcp/CountryBiasMap/CountryList/CountryList.tsx @@ -120,7 +120,7 @@ const CountryList: FC = ({ [styles.CardSelected]: isSelected, })} > - + {c.name} {Math.round(c.confidence * 100)}% diff --git a/src/uxcore/components/_uxcp/CountryBiasMap/CountryMap/CountryMap.tsx b/src/uxcore/components/_uxcp/CountryBiasMap/CountryMap/CountryMap.tsx index 4ac19102..3a8b2ef8 100644 --- a/src/uxcore/components/_uxcp/CountryBiasMap/CountryMap/CountryMap.tsx +++ b/src/uxcore/components/_uxcp/CountryBiasMap/CountryMap/CountryMap.tsx @@ -434,7 +434,11 @@ const CountryMap: FC = ({ }} >
- + {hoveredData.name}
diff --git a/src/uxcore/components/_uxcp/CountryBiasMap/FlagImage/FlagImage.tsx b/src/uxcore/components/_uxcp/CountryBiasMap/FlagImage/FlagImage.tsx index 19d2d9f9..d67d8106 100644 --- a/src/uxcore/components/_uxcp/CountryBiasMap/FlagImage/FlagImage.tsx +++ b/src/uxcore/components/_uxcp/CountryBiasMap/FlagImage/FlagImage.tsx @@ -5,6 +5,7 @@ import styles from './FlagImage.module.scss'; interface FlagImageProps { countryCode: string; + countryName?: string; size?: number; className?: string; } @@ -20,6 +21,7 @@ const codeToEmoji = (code: string): string => { const FlagImage: FC = ({ countryCode, + countryName, size = 20, className = '', }) => { @@ -58,7 +60,7 @@ const FlagImage: FC = ({ srcSet={`https://flagcdn.com/w${cdnW2x}/${code}.png 2x`} width={w} height={size} - alt="" + alt={`Flag of ${countryName || countryCode.toUpperCase()}`} className={cn(styles.Flag, className)} style={{ width: w, height: size }} loading="lazy" From 08ce9dc95c50b03adbd3eaae87d798dabd759f79 Mon Sep 17 00:00:00 2001 From: MaryWylde Date: Wed, 5 Aug 2026 14:59:40 +0200 Subject: [PATCH 2/2] fix(seo): stop the canonical pointing at a redirect, noindex the 404 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The locale-root canonical was built from asPath, and the `asPath === '/'` guard only catches the bare root. Add any query string and the path fell through as "/?x=1", which cleanURL trimmed back to "/" — yielding https://keepsimple.io/ru/ and /hy/, both of which 308 to the slashless form. Ahrefs surfaced it via a scanner's ?phpinfo=1 probe, but it hit every UTM-tagged link to the RU and HY homepages too. English is unaffected: it has no locale prefix, so the path is "/" and the domain root never redirects. Also flip the 404 page from "index, follow" to "noindex, follow" — it was inviting Google to index the error page. Co-Authored-By: Claude Opus 4.7 --- src/components/SeoGenerator/SeoGenerator.tsx | 5 ++++- src/pages/404.tsx | 2 +- src/uxcore/components/SeoGenerator/SeoGenerator.tsx | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/SeoGenerator/SeoGenerator.tsx b/src/components/SeoGenerator/SeoGenerator.tsx index 79ec7e2a..f9ff429e 100644 --- a/src/components/SeoGenerator/SeoGenerator.tsx +++ b/src/components/SeoGenerator/SeoGenerator.tsx @@ -163,8 +163,11 @@ const SeoGenerator: FC = ({ return clean; } + // A lone "/" here yields .../ru/ or .../hy/, which 308-redirects to the + // slashless form and makes the canonical point at a redirect. + const canonicalPath = cleanURL(alternateLink).replace(/^\/(?=$|[?#])/, ''); const originalUrl = - process.env.NEXT_PUBLIC_DOMAIN + localePath + cleanURL(alternateLink); + process.env.NEXT_PUBLIC_DOMAIN + localePath + canonicalPath; const favIcon = `${process.env.NEXT_PUBLIC_DOMAIN}${favIconPath}`; const schema = generateSchema( title, diff --git a/src/pages/404.tsx b/src/pages/404.tsx index b61eddea..d2670b2d 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -22,7 +22,7 @@ const Custom404: FC = ({ intl, locale }) => { return ( - + Keepsimple | Error Page diff --git a/src/uxcore/components/SeoGenerator/SeoGenerator.tsx b/src/uxcore/components/SeoGenerator/SeoGenerator.tsx index 6be71ffc..555d3773 100644 --- a/src/uxcore/components/SeoGenerator/SeoGenerator.tsx +++ b/src/uxcore/components/SeoGenerator/SeoGenerator.tsx @@ -181,8 +181,11 @@ const SeoGenerator: FC = ({ return clean; } + // A lone "/" here yields .../ru/ or .../hy/, which 308-redirects to the + // slashless form and makes the canonical point at a redirect. + const canonicalPath = cleanURL(alternateLink).replace(/^\/(?=$|[?#])/, ''); const originalUrl = - process.env.NEXT_PUBLIC_DOMAIN + localePath + cleanURL(alternateLink); + process.env.NEXT_PUBLIC_DOMAIN + localePath + canonicalPath; const metaDescription = isBiasHrView ? hrDescriptionRandom[0] : stripHTML(description);