Closed elisabetperez closed 2 months ago
Hello :-) Your configuration is not correct.
It should look like this.
modules: [ '@nuxtjs/supabase', '@nuxtjs/sanity', ['@nuxtjs/robots', { rules: [ { UserAgent: '*' }, { Disallow: '' }, { BlankLine: true }, { Comment: 'Comment here' }, ] }] ],
I hope this was helpful.
@kreativwolke, it might be worth including your code in the sample on the readme. It's definitely documented. But, I ended up here trying to figure it out as well.
same here !
Hello :-) Your configuration is not correct.
It should look like this.
modules: [ '@nuxtjs/supabase', '@nuxtjs/sanity', ['@nuxtjs/robots', { rules: [ { UserAgent: '*' }, { Disallow: '' }, { BlankLine: true }, { Comment: 'Comment here' }, ] }] ],
I hope this was helpful.
Thanks, I followed and robots.txt worked!!
Hello Guys,
I'm actually facing the same problem, is it being resolved?
Output: User-agent: * Disallow:
modules: [ "@pinia/nuxt", "@vesp/nuxt-fontawesome", "@ambitiondev/nuxt-cookiebot", "nuxt-swiper", [ "@nuxtjs/robots", { UserAgent: "*", Disallow: "/", }, ], ],
@kreativwolke already provided a solution 🤷🏻 Each rule must be added as a separate array entry (Rule).
There's also an example in the docs https://nuxt.com/modules/robots#robots-config
In your case, @bolddkdev , it should be:
modules: [
// ...
["@nuxtjs/robots", {
rules: [
{ UserAgent: "*" },
{ Disallow: "/" },
],
}]
],
or
modules: [
// ...
"@nuxtjs/robots",
],
robots: {
rules: [
{ UserAgent: "*" },
{ Disallow: "/" },
],
},
Hello, I'm using @nuxtjs/robots version 3.0.0 and whatever I write inside the options of the module is not being displayed in my robots.txt.
This is my module inside nuxt.config.js:
and my output is simply:
Could you help me find it why? Thanks