For dynamic routes (eg. /pages/_id.vue), you have to declare them with the routes property. This option can be an array or a function. In addition, the routes defined in generate.routes will be automatically used for the sitemap.
This is misleading since in addition is wrong.
As seen here https://github.com/nuxt-community/sitemap-module/blob/dev/lib/options.js#L24nuxtInstance.options.generate.routes is only taken as default option if sitemap.routes is not specified. So we should either change the documentation or the functionality. Personally I would like to have the behavior that the generate.routes are always taken, and I can additional specify routes in the sitemap options that are used together with the ones from generate.routes.
The use case that I have is that I do not want all pages pre-generated, but I want them all shown in the sitemap.xml file.
Is there maybe a simple way I can get this behavior. Both, sitemap.routes and generate.routes, are async functions in my case.
Hello, in the documentation (https://sitemap.nuxtjs.org/usage/sitemap) is written
This is misleading since in addition is wrong. As seen here https://github.com/nuxt-community/sitemap-module/blob/dev/lib/options.js#L24
nuxtInstance.options.generate.routes
is only taken as default option if sitemap.routes is not specified. So we should either change the documentation or the functionality. Personally I would like to have the behavior that thegenerate.routes
are always taken, and I can additional specify routes in the sitemap options that are used together with the ones fromgenerate.routes
.The use case that I have is that I do not want all pages pre-generated, but I want them all shown in the sitemap.xml file.
Is there maybe a simple way I can get this behavior. Both,
sitemap.routes
andgenerate.routes
, are async functions in my case.