Nuxt Robots integrates with Nuxt Content out of the box. Allowing you to configure if a page should be indexable or not right from your markdown files.
Setup
Simply use the
---
robots: false
---
This will require that your markdown files have an associated path. When using Document Driven Mode, all markdown files will automatically have a path set.
Otherwise, you will need to make sure your markdown files have a
---
path: /foo
robots: false
---
Requirements
The Nuxt Content integration does not currently work with the v3 of Nuxt Content. It also won't work when using deploying your site with Cloudflare.
It's recommended to manually disable to integration in these cases:
export default defineNuxtConfig({
robots: {
disableNuxtContentIntegration: true,
}
})
How it works
This will add an entry to your
User-agent: *
Disallow: /foo
It will add the