Skip to content

Commit 0b67224

Browse files
committedAug 21, 2024
fix: show debug in meta tag if debug is enabled
1 parent 2801b8a commit 0b67224

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

Diff for: ‎src/runtime/nuxt/plugins/robot-meta.server.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineNuxtPlugin } from 'nuxt/app'
22
import {
33
useRequestEvent,
4+
useRuntimeConfig,
45
useServerHead,
56
} from '#imports'
67

@@ -11,12 +12,14 @@ export default defineNuxtPlugin({
1112
// set from nitro, not available for internal routes
1213
if (!ctx)
1314
return
15+
const config = useRuntimeConfig()
16+
1417
useServerHead({
1518
meta: [
1619
{
1720
'name': 'robots',
1821
'content': () => ctx.rule || '',
19-
'data-hint': (import.meta.dev && !ctx.indexable) ? 'disabled in development' : undefined,
22+
'data-hint': () => config['nuxt-robots']?.debug ? ctx.debug?.source : undefined,
2023
},
2124
],
2225
})

0 commit comments

Comments
 (0)
Please sign in to comment.