Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robots.txt output is not what I write in nuxt.config.js #118

Open
elisabetperez opened this issue Feb 28, 2024 · 5 comments
Open

Robots.txt output is not what I write in nuxt.config.js #118

elisabetperez opened this issue Feb 28, 2024 · 5 comments

Comments

@elisabetperez
Copy link

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:

modules: [
    '@nuxtjs/supabase',
    '@nuxtjs/sanity',
    ['@nuxtjs/robots', {
      UserAgent: '*',
      Disallow: '',
      BlankLine: true ,
      Comment: 'Comment here',
    }]
  ],

and my output is simply:

User-agent: *
Disallow: 

Could you help me find it why? Thanks

@kreativwolke
Copy link

kreativwolke commented Mar 1, 2024

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.

@eric-scott-owens
Copy link

eric-scott-owens commented May 3, 2024

@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.

@Hoan-Duong
Copy link

same here !

@Hoan-Duong
Copy link

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!!

@bolddkdev
Copy link

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: "/", }, ], ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants