@kp
in my experience, the biggest benefit of using a module such as @nuxtjs/robots presents itself when you pass it a function rather than a static object. This means that you can decide based on your data whether or not a path should be allowed or disallowed.
I parse a index: true | false value from the front-matter of my markdown articles and use that to dynamically generate my robots.txt on nuxt generate.
@saul
just seeing your reply as I’ve not been on here. thanks for the explanation! Would this make a difference for universal mode sites, does the module provide the same benefits?
I'd imagine so, but only during the nuxt build step. I don't think it would be able to update based on data changes alone whilst the application is running via nuxt start. Looking into the codebase itself or posting an issue with a question should get you a clearer answer though 👍
@siliconmachine what is the advantage of using this module over simply adding a robots.txt file in static/robots.txt ?
@kp in my experience, the biggest benefit of using a module such as
@nuxtjs/robots
presents itself when you pass it a function rather than a static object. This means that you can decide based on your data whether or not a path should be allowed or disallowed.I parse a
index: true | false
value from the front-matter of my markdown articles and use that to dynamically generate myrobots.txt
onnuxt generate
.I hope that provides a good example?
@saul just seeing your reply as I’ve not been on here. thanks for the explanation! Would this make a difference for universal mode sites, does the module provide the same benefits?
I'd imagine so, but only during the
nuxt build
step. I don't think it would be able to update based on data changes alone whilst the application is running vianuxt start
. Looking into the codebase itself or posting an issue with a question should get you a clearer answer though 👍Sounds good thanks @saul