You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/2.guides/2.route-rules.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ You can provide the following rules:
9
9
10
10
-`{ robots: false }`{lang="json"} - Will disable the route from being indexed using the [robotsDisabledValue](/docs/robots/api/config#robotsdisabledvalue) config.
11
11
-`{ robots: '<rule>' }`{lang="json"} - Will add the provided string as the robots rule
12
+
-`{ robots: { /* directives */ } }`{lang="json"} - Will use object syntax to define robot directives
View and control the robots rule using a simple reactivity API.
10
+
View and control the robots rule using a simple reactivity API. Supports standard directives (index, noindex, follow, nofollow) and non-standard directives like noai and noimageai.
11
11
12
12
It's recommended to use this composable when you need to dynamically change the robots rule at runtime. For example when a user changes their profile from private to public.
13
13
@@ -35,6 +35,27 @@ import { useRobotsRule } from '#imports'
35
35
const rule =useRobotsRule(true) // does not do anything, just returns the value
36
36
```
37
37
38
+
## Available Directives
39
+
40
+
When using the object syntax, you can use the following directives:
41
+
42
+
### Standard Directives
43
+
-`index`: Allow search engines to index the page
44
+
-`noindex`: Prevent search engines from indexing the page
45
+
-`follow`: Allow search engines to follow links on the page
46
+
-`nofollow`: Prevent search engines from following links on the page
47
+
-`none`: Equivalent to `noindex, nofollow`
48
+
-`all`: Equivalent to `index, follow`
49
+
50
+
### Non-Standard Directives
51
+
-`noai`: Request AI crawlers not to use content for training
52
+
-`noimageai`: Request AI crawlers not to use images for training
53
+
54
+
### Preview Control Directives
55
+
-`max-image-preview`: Controls image preview size (`'none'`, `'standard'`, or `'large'`)
56
+
-`max-snippet`: Controls text snippet length in characters (use `-1` for no limit)
57
+
-`max-video-preview`: Controls video preview length in seconds (use `-1` for no limit)
0 commit comments