Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Box: FC<CookiesBoxProps> = ({ setIsSeen }) => {
>
<Image
src="/keepsimple_/assets/cookies/close.svg"
alt=""
alt="Close cookie notice"
width={26}
height={26}
className={styles.closeIcon}
Expand Down
5 changes: 4 additions & 1 deletion src/components/SeoGenerator/SeoGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const EnvironmentSubSection: FC<EnvironmentSubSectionProps> = ({
})}
>
<div className={styles.titleAndIcon}>
<Image src={iconUrl} alt={''} width={24} height={24} unoptimized />
<Image src={iconUrl} alt={name} width={24} height={24} unoptimized />
<span className={styles.title}> {name}</span>
</div>
<hr className={styles.hr} />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Custom404: FC<Custom404Props> = ({ intl, locale }) => {
return (
<Fragment>
<Head>
<meta name="robots" content={'index, follow'} />
<meta name="robots" content={'noindex, follow'} />
<title>Keepsimple | Error Page</title>
<link rel="shortcut icon" href={'/keepsimple_/assets/favicon.svg'} />
<meta name="description" content={'404 page - page not found'} />
Expand Down
5 changes: 4 additions & 1 deletion src/uxcore/components/SeoGenerator/SeoGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const BiasPanel = forwardRef<HTMLDivElement, BiasPanelProps>(
<div className={styles.Header}>
<FlagImage
countryCode={country.id}
countryName={country.name}
size={40}
className={styles.HeaderFlag}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const CountryList: FC<CountryListProps> = ({
[styles.CardSelected]: isSelected,
})}
>
<FlagImage countryCode={c.id} size={18} />
<FlagImage countryCode={c.id} countryName={c.name} size={18} />
<span className={styles.CardName}>{c.name}</span>
<span className={styles.CardConfidence}>
{Math.round(c.confidence * 100)}%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,11 @@ const CountryMap: FC<CountryMapProps> = ({
}}
>
<div className={styles.TooltipHead}>
<FlagImage countryCode={hoveredData.id} size={16} />
<FlagImage
countryCode={hoveredData.id}
countryName={hoveredData.name}
size={16}
/>
<span className={styles.TooltipName}>{hoveredData.name}</span>
</div>
<div className={styles.TooltipMeta}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import styles from './FlagImage.module.scss';

interface FlagImageProps {
countryCode: string;
countryName?: string;
size?: number;
className?: string;
}
Expand All @@ -20,6 +21,7 @@ const codeToEmoji = (code: string): string => {

const FlagImage: FC<FlagImageProps> = ({
countryCode,
countryName,
size = 20,
className = '',
}) => {
Expand Down Expand Up @@ -58,7 +60,7 @@ const FlagImage: FC<FlagImageProps> = ({
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"
Expand Down
Loading