Package Exports
- @nuxtjs/robots
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nuxtjs/robots) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@nuxtjs/robots
A NuxtJS module thats inject a middleware to generate a robots.txt file
Setup
- Add the
@nuxtjs/robotsdependency withyarnornpmto your project - Add
@nuxtjs/robotsto themodulessection ofnuxt.config.js - Configure it:
{
modules: [
// Simple usage
'@nuxtjs/robots',
// With options
['@nuxtjs/robots', {
UserAgent: 'Googlebot',
Disallow: '/'
}]
]
}Using top level options
{
modules: [
'@nuxtjs/robots'
],
robots: {
UserAgent: '*',
Disallow: '/'
}
}Options
The module option parameter can be an object (like above) or an array of objects.
{
modules: [
'@nuxtjs/robots'
],
robots: [
{
UserAgent: 'Googlebot',
Disallow: '/users'
},
{
UserAgent: 'Bingbot',
Disallow: '/admin'
}
]
}Will generate a /robots.txt
UserAgent: Googlebot
Disallow: /users
UserAgent: Bingbot
Disallow: /adminDevelopment
- Clone this repository
- Install dependencies using
yarn installornpm install - Start development server using
npm run dev
License
Thanks William DA SILVA for making this module
Copyright (c) - Nuxt Community