@@ -7,7 +7,7 @@ import { matchPathToRule, normaliseRobotsRouteRule } from '../../util'
7
7
import { useRuntimeConfig } from '#imports'
8
8
import { getSiteRobotConfig } from '#internal/nuxt-robots'
9
9
10
- export function getPathRobotConfig ( e : H3Event , options ?: { userAgent ?: string , skipSiteIndexable ?: boolean , path ?: string } ) {
10
+ export function getPathRobotConfig ( e : H3Event , options ?: { userAgent ?: string , skipSiteIndexable ?: boolean , path ?: string } ) : { rule : string , indexable : boolean , debug ?: { source : string , line : string } } {
11
11
// has already been resolved
12
12
const { robotsDisabledValue, robotsEnabledValue, usingNuxtContent } = useRuntimeConfig ( ) [ 'nuxt-robots' ]
13
13
if ( ! options ?. skipSiteIndexable ) {
@@ -38,7 +38,7 @@ export function getPathRobotConfig(e: H3Event, options?: { userAgent?: string, s
38
38
if ( robotsTxtRule ) {
39
39
if ( ! robotsTxtRule . allow ) {
40
40
return {
41
- allow : false ,
41
+ indexable : false ,
42
42
rule : robotsDisabledValue ,
43
43
debug : {
44
44
source : '/robots.txt' ,
@@ -54,7 +54,7 @@ export function getPathRobotConfig(e: H3Event, options?: { userAgent?: string, s
54
54
// 2. nuxt content rules
55
55
if ( usingNuxtContent && nitroApp . _robots ?. nuxtContentUrls ?. has ( withoutTrailingSlash ( path ) ) ) {
56
56
return {
57
- allow : false ,
57
+ indexable : false ,
58
58
rule : robotsDisabledValue ,
59
59
debug : {
60
60
source : 'Nuxt Content' ,
@@ -67,15 +67,15 @@ export function getPathRobotConfig(e: H3Event, options?: { userAgent?: string, s
67
67
const routeRules = normaliseRobotsRouteRule ( nitroApp . _robotsRuleMactcher ( path ) )
68
68
if ( routeRules ) {
69
69
return {
70
- allow : routeRules . allow ,
70
+ indexable : routeRules . allow ,
71
71
rule : routeRules . rule || ( routeRules . allow ? robotsEnabledValue : robotsDisabledValue ) ,
72
72
debug : {
73
73
source : 'Route Rules' ,
74
74
} ,
75
75
}
76
76
}
77
77
return {
78
- allow : true ,
78
+ indexable : true ,
79
79
rule : robotsEnabledValue ,
80
80
}
81
81
}
0 commit comments