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

if sitemap.routes is specified generator.routes is not used anymore #259

Open
Fabioni opened this issue Jul 30, 2022 · 0 comments
Open

if sitemap.routes is specified generator.routes is not used anymore #259

Fabioni opened this issue Jul 30, 2022 · 0 comments

Comments

@Fabioni
Copy link

Fabioni commented Jul 30, 2022

Hello,
in the documentation (https://sitemap.nuxtjs.org/usage/sitemap) is written

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

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

1 participant