Index of every page on this site: llms.txt
All skills
nuxt-modules avatar

/nuxtjs-robots

@61445f6
by Nuxt Modulesnuxt-modules/robots529 stars
54
Run it yourself

Controls crawling and indexing in Nuxt with @nuxtjs/robots, which generates robots.txt, the X-Robots-Tag header, and the robots meta tag. Use when a task mentions robots.txt, noindex, nofollow, keeping staging or preview sites out of Google, the robots config key, robots route rules, useRobotsRule, getPathRobotConfig, getSiteRobotConfig, useBotDetection, getBotDetection, blockAiBots, AI crawlers, or a page that is still indexed or wrongly blocked.

  • 2 files
  • 11.5 KB
  • MIT
  • Updated 3 days ago
  • GitHub
Use this Skill: https://skilld.dev/gh/nuxt-modules/robots/nuxtjs-robots

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesintegrations.md

≈486 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Integrations

Tested with @nuxtjs/robots 6.2.4, Nuxt 4.6.0, @nuxt/content 3.16.1, zod 4.6.5, and @nuxtjs/i18n 10.6.0.

Nuxt Content v3

Add the robots frontmatter key to a collection. If you use Valibot, install valibot and @valibot/to-json-schema. Import defineRobotsSchema() from @nuxtjs/robots/content/valibot and use it in v.object().

For the Zod example below, add zod 4 to your own dependencies. Without it the schema resolves Content's zod 3. Then robots: false arrives as the string "false", and the page sends X-Robots-Tag: false and content="false". Nothing warns.

// content.config.ts
import { defineCollection, defineContentConfig } from '@nuxt/content'
import { defineRobotsSchema } from '@nuxtjs/robots/content'
import { z } from 'zod'

export default defineContentConfig({
  collections: {
    content: defineCollection({
      type: 'page',
      source: '**/*.md',
      schema: z.object({ robots: defineRobotsSchema() }),
    }),
  },
})
<!-- app/pages/[...slug].vue -->
<script setup lang="ts">
import { queryCollection, useAsyncData, useRobotsRule, useRoute, useSeoMeta } from '#imports'

const route = useRoute()
const { data: page } = await useAsyncData(`page-${route.path}`, () => queryCollection('content').path(route.path).first())
// The meta tag comes from page.seo. Only useRobotsRule() also sets the header.
useSeoMeta(page.value?.seo || {})
// Content returns null for an unset key. Robots 7 ignores null and undefined, so the default rule stays.
useRobotsRule(page.value?.robots ?? undefined)
</script>

<template>
  <div>{{ page?.title }}</div>
</template>

Nuxt i18n

allow and disallow paths get one entry per locale prefix, and the unprefixed path stays. Opt out with _skipI18n: true in a group, or with robots.autoI18n: false. Write route rules without the locale prefix. They match locale-prefixed paths, also with autoI18n: false.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 61445f6. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 3 days ago
Other metadata
compatibility
Requires Node.js ^22.22.3 || ^24.15.0 || >=26.0.0. Requires Nuxt ^4.6.0 || ^5.0.0.

README badge

README badge for nuxt-modules/robots