Skip to content

Commit 6fb9544

Browse files
committed
chore: broken tests
1 parent 61d6d34 commit 6fb9544

File tree

13 files changed

+81
-46
lines changed

13 files changed

+81
-46
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template>
2+
<div>
3+
<h1>AI Blocked String Page</h1>
4+
<p>This page blocks AI using string syntax for the noai directive.</p>
5+
</div>
6+
</template>

.playground/pages/ai-blocked.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template>
2+
<div>
3+
<h1>AI Blocked Page</h1>
4+
<p>This page blocks AI crawlers using the noai directive.</p>
5+
</div>
6+
</template>

.playground/pages/ai-test.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<script setup>
1+
<script setup lang="ts">
2+
import { useRobotsRule } from '#robots/app/composables/useRobotsRule'
3+
24
const robotRule = useRobotsRule()
35
46
function blockAI() {

.playground/pages/custom-rule.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template>
2+
<div>
3+
<h1>Custom Rule Page</h1>
4+
<p>This page uses combined custom rules with noindex and noai directives.</p>
5+
</div>
6+
</template>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template>
2+
<div>
3+
<h1>Images AI Blocked Page</h1>
4+
<p>This page blocks AI image crawlers using the noimageai directive.</p>
5+
</div>
6+
</template>

.playground/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./.nuxt/tsconfig.json"
3+
}

docs/content/2.guides/1.disable-page-indexing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ rule.value = 'noindex, nofollow'
4444
useRobotsRule({ noindex: true, nofollow: true })
4545

4646
// Combining with AI-specific directives
47-
useRobotsRule({
48-
noindex: true,
49-
noai: true, // Prevent AI crawlers from using content
50-
noimageai: true // Prevent AI crawlers from using images
47+
useRobotsRule({
48+
noindex: true,
49+
noai: true, // Prevent AI crawlers from using content
50+
noimageai: true // Prevent AI crawlers from using images
5151
})
5252
```
5353

docs/content/2.guides/2.route-rules.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ export default defineNuxtConfig({
4141
// use the `robots` rule if you need finer control
4242
'/custom-robots': { robots: 'index, follow' },
4343
// use object syntax for more complex rules
44-
'/ai-protected': {
45-
robots: {
46-
index: true,
47-
noai: true,
48-
noimageai: true
49-
}
44+
'/ai-protected': {
45+
robots: {
46+
index: true,
47+
noai: true,
48+
noimageai: true
49+
}
5050
},
5151
// control search result previews
5252
'/limited-preview': {
5353
robots: {
54-
index: true,
54+
'index': true,
5555
'max-image-preview': 'standard',
5656
'max-snippet': 100,
5757
'max-video-preview': 15

docs/content/3.api/0.use-robots-rule.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,16 @@ import { useRobotsRule } from '#imports'
117117

118118
// Control search result preview settings
119119
useRobotsRule({
120-
index: true,
120+
'index': true,
121121
'max-image-preview': 'large', // 'none', 'standard', or 'large'
122-
'max-snippet': 150, // number of characters
123-
'max-video-preview': 30 // seconds of video preview
122+
'max-snippet': 150, // number of characters
123+
'max-video-preview': 30 // seconds of video preview
124124
})
125125
// Ref<'index, max-image-preview:large, max-snippet:150, max-video-preview:30'>
126126

127127
// Disable all previews
128128
useRobotsRule({
129-
index: true,
129+
'index': true,
130130
'max-image-preview': 'none',
131131
'max-snippet': 0,
132132
'max-video-preview': 0

test/e2e/groups.test.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ const { resolve } = createResolver(import.meta.url)
66

77
process.env.NODE_ENV = 'production'
88

9-
await setup({
10-
rootDir: resolve('../../.playground'),
11-
build: true,
12-
server: true,
13-
nuxtConfig: {
14-
robots: {
15-
groups: [
16-
{
17-
userAgent: [
18-
'Googlebot',
19-
],
20-
disallow: [
21-
'/test/',
22-
'/test3',
23-
],
24-
},
25-
{
26-
userAgent: [
27-
'Bingbot',
28-
'Yandex',
29-
],
30-
disallow: [
31-
'/test2/',
32-
],
33-
},
34-
],
9+
describe('stack', async () => {
10+
await setup({
11+
rootDir: resolve('../../.playground'),
12+
build: true,
13+
server: true,
14+
nuxtConfig: {
15+
robots: {
16+
groups: [
17+
{
18+
userAgent: [
19+
'Googlebot',
20+
],
21+
disallow: [
22+
'/test/',
23+
'/test3',
24+
],
25+
},
26+
{
27+
userAgent: [
28+
'Bingbot',
29+
'Yandex',
30+
],
31+
disallow: [
32+
'/test2/',
33+
],
34+
},
35+
],
36+
},
3537
},
36-
},
37-
})
38+
})
3839

39-
describe('stack', () => {
4040
it('basic', async () => {
4141
expect(await $fetch('/robots.txt')).toMatchInlineSnapshot(`
4242
"# START nuxt-robots (indexable)

0 commit comments

Comments
 (0)