File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { defu } from 'defu'
15
15
import { installNuxtSiteConfig , updateSiteConfig } from 'nuxt-site-config/kit'
16
16
import { relative } from 'pathe'
17
17
import { readPackageJSON } from 'pkg-types'
18
+ import { withTrailingSlash } from 'ufo'
18
19
import { AiBots , NonHelpfulBots } from './const'
19
20
import { setupDevToolsUI } from './devtools'
20
21
import { resolveI18nConfig , splitPathForI18nLocales } from './i18n'
@@ -411,14 +412,20 @@ export default defineNuxtModule<ModuleOptions>({
411
412
}
412
413
}
413
414
414
- config . groups = config . groups . map ( normalizeGroup )
415
+ const groups = config . groups . map ( normalizeGroup )
416
+ const pathsToCheck = [ '/_nuxt' , '/_nuxt/' , '/api' , '/api/' ]
417
+ for ( const p of pathsToCheck ) {
418
+ if ( groups . some ( g => g . disallow . includes ( p ) ) ) {
419
+ logger . warn ( `You have disallowed robots accessing \`${ withTrailingSlash ( p ) } **\`, this may prevent your site from being indexed correctly.` )
420
+ }
421
+ }
415
422
416
423
nuxt . options . runtimeConfig [ 'nuxt-robots' ] = {
417
424
version : version || '' ,
418
425
usingNuxtContent,
419
426
debug : config . debug ,
420
427
credits : config . credits ,
421
- groups : config . groups ,
428
+ groups,
422
429
sitemap : config . sitemap ,
423
430
header : config . header ,
424
431
robotsEnabledValue : config . robotsEnabledValue ,
You can’t perform that action at this time.
0 commit comments