File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
dotcom-rendering/src/server Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,15 @@ export const htmlPageTemplate = (props: WebProps | AppProps): string => {
76
76
config,
77
77
} = props ;
78
78
79
- const doNotIndex = canonicalUrl ?. includes ( 'tracking/commissioningdesk' ) ;
79
+ const doNotIndex = ( ) : boolean => {
80
+ const isDevelopment = process . env . GU_STAGE !== 'PROD' ;
81
+
82
+ const hasNoIndexPattern = Boolean (
83
+ canonicalUrl ?. includes ( 'tracking/commissioningdesk' ) ,
84
+ ) ;
85
+
86
+ return isDevelopment || hasNoIndexPattern ;
87
+ } ;
80
88
81
89
/**
82
90
* We escape windowGuardian here to prevent errors when the data
@@ -265,7 +273,7 @@ https://workforus.theguardian.com/careers/product-engineering/
265
273
<!-- This tag enables pages to be featured in Google Discover as large previews
266
274
See: https://developers.google.com/search/docs/advanced/mobile/google-discover?hl=en&visit_id=637424198370039526-3805703503&rd=1 -->
267
275
<meta name="robots" content="max-image-preview:large">
268
- ${ doNotIndex ? '<meta name="robots" content="noindex">' : '' }
276
+ ${ doNotIndex ( ) ? '<meta name="robots" content="noindex">' : '' }
269
277
270
278
<script>
271
279
window.guardian = ${ windowGuardian } ;
You can’t perform that action at this time.
0 commit comments