File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,18 @@ const deployedTranslations = [
2222 'zh-hans' ,
2323 'es' ,
2424 // We'll add more languages when they have enough content.
25+ // Please DO NOT edit this list without a discussion in the reactjs/react.dev repo.
26+ // It must be the same between all translations.
2527] ;
2628
29+ let shouldPreventIndexing = false ;
30+ if (
31+ siteConfig . languageCode !== 'en' &&
32+ ! deployedTranslations . includes ( siteConfig . languageCode )
33+ ) {
34+ shouldPreventIndexing = true ;
35+ }
36+
2737function getDomain ( languageCode : string ) : string {
2838 const subdomain = languageCode === 'en' ? '' : languageCode + '.' ;
2939 return subdomain + 'react.dev' ;
@@ -59,6 +69,7 @@ export const Seo = withRouter(
5969 href = { canonicalUrl . replace ( siteDomain , getDomain ( 'en' ) ) }
6070 hrefLang = "x-default"
6171 />
72+ { shouldPreventIndexing && < meta name = "robots" content = "noindex" /> }
6273 { deployedTranslations . map ( ( languageCode ) => (
6374 < link
6475 key = { 'alt-' + languageCode }
You can’t perform that action at this time.
0 commit comments