File tree Expand file tree Collapse file tree 1 file changed +24
-17
lines changed
Expand file tree Collapse file tree 1 file changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -5,22 +5,29 @@ invariant(process.env.NEXT_PUBLIC_ORIGIN, "NEXT_PUBLIC_ORIGIN must be defined")
55const BASE_URL : string = process . env . NEXT_PUBLIC_ORIGIN
66
77export default function robots ( ) : MetadataRoute . Robots {
8- const sitemap =
9- process . env . MITOL_NOINDEX === "false"
10- ? `${ BASE_URL } /sitemaps/sitemap-index.xml`
11- : undefined
12- return {
13- rules : {
14- userAgent : "*" ,
15- allow : "/" ,
16- disallow : [
17- "/dashboard/" ,
18- "/learningpaths/" ,
19- "/onboarding/" ,
20- "/cart/" ,
21- "/program_letter/" ,
22- ] ,
23- } ,
24- sitemap,
8+ const shouldIndex = process . env . MITOL_NOINDEX === "false"
9+
10+ if ( shouldIndex ) {
11+ return {
12+ rules : {
13+ userAgent : "*" ,
14+ allow : "/" ,
15+ disallow : [
16+ "/dashboard/" ,
17+ "/learningpaths/" ,
18+ "/onboarding/" ,
19+ "/cart/" ,
20+ "/program_letter/" ,
21+ ] ,
22+ } ,
23+ sitemap : `${ BASE_URL } /sitemaps/sitemap-index.xml` ,
24+ }
25+ } else {
26+ return {
27+ rules : {
28+ userAgent : "*" ,
29+ disallow : "/" ,
30+ } ,
31+ }
2532 }
2633}
You can’t perform that action at this time.
0 commit comments