nuxt-modules / robots

Tame the robots crawling and indexing your Nuxt site.
https://nuxtseo.com/robots
412 stars 30 forks source link

Robots.txt output dir location #33

Closed Qvatra closed 4 years ago

Qvatra commented 4 years ago

It would be nice to add location for output file like sitemap-module does it: https://github.com/nuxt-community/sitemap-module

when in 'universal' mode I would like this file to end up in my static folder but by default it is located at dist/

or maybe I'm doing something wrong? I assume I have to run nuxt generate in order to trigger build of robots.txt file, right? Or can I somehow indicate that it also should be built when running nuxt build?

ricardogobbosouza commented 4 years ago

Hi @Qvatra In universal mode the robots.txt file is not generated, @nuxtjs/robots-module uses middleware which when access /robots.txt, it responds with its configuration https://github.com/nuxt-community/robots-module/blob/master/lib/module.js#L30

Note: nuxt generate is for static site generation, here yesrobots.txt is generated https://github.com/nuxt-community/robots-module/blob/master/lib/module.js#L22

Sorry for the late answer