Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/reactjs/reactjs.org into sy…
Browse files Browse the repository at this point in the history
…nc-dfd15e87
  • Loading branch information
docschina-bot committed Sep 20, 2023
2 parents 581b50d + dfd15e8 commit d6d46f3
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/components/Seo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,12 @@ const deployedTranslations = [
'en',
'zh-hans',
'es',
'fr',
// We'll add more languages when they have enough content.
// Please DO NOT edit this list without a discussion in the reactjs/react.dev repo.
// It must be the same between all translations.
];

let shouldPreventIndexing = false;
if (
siteConfig.languageCode !== 'en' &&
!deployedTranslations.includes(siteConfig.languageCode)
) {
shouldPreventIndexing = true;
}

function getDomain(languageCode: string): string {
const subdomain = languageCode === 'en' ? '' : languageCode + '.';
return subdomain + 'react.dev';
Expand Down Expand Up @@ -69,7 +62,6 @@ export const Seo = withRouter(
href={canonicalUrl.replace(siteDomain, getDomain('en'))}
hrefLang="x-default"
/>
{shouldPreventIndexing && <meta name="robots" content="noindex" />}
{deployedTranslations.map((languageCode) => (
<link
key={'alt-' + languageCode}
Expand Down

0 comments on commit d6d46f3

Please sign in to comment.