File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,18 @@ const deployedTranslations = [
22
22
'zh-hans' ,
23
23
'es' ,
24
24
// 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.
25
27
] ;
26
28
29
+ let shouldPreventIndexing = false ;
30
+ if (
31
+ siteConfig . languageCode !== 'en' &&
32
+ ! deployedTranslations . includes ( siteConfig . languageCode )
33
+ ) {
34
+ shouldPreventIndexing = true ;
35
+ }
36
+
27
37
function getDomain ( languageCode : string ) : string {
28
38
const subdomain = languageCode === 'en' ? '' : languageCode + '.' ;
29
39
return subdomain + 'react.dev' ;
@@ -59,6 +69,7 @@ export const Seo = withRouter(
59
69
href = { canonicalUrl . replace ( siteDomain , getDomain ( 'en' ) ) }
60
70
hrefLang = "x-default"
61
71
/>
72
+ { shouldPreventIndexing && < meta name = "robots" content = "noindex" /> }
62
73
{ deployedTranslations . map ( ( languageCode ) => (
63
74
< link
64
75
key = { 'alt-' + languageCode }
You can’t perform that action at this time.
0 commit comments