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

sitemap won't generate when indexing is disabled #384

Open
Viandoks opened this issue Nov 20, 2024 · 2 comments
Open

sitemap won't generate when indexing is disabled #384

Viandoks opened this issue Nov 20, 2024 · 2 comments

Comments

@Viandoks
Copy link

With @nuxtjs/robots v4 and @nuxtjs/sitemap v6 and when setting the disallow option to '/' the sitemap is not being generated properly.

While I understand that a non indexable website shouldn't have a sitemap, in practice we are often forced to do things we shouldn't do in the first place.

My robots.config:

[
    userAgent: '*',
    disallow: '/' ,
] 

the sitemap generated contains only one line:

http://mywebsite.com/

When downgrading to @nuxtjs/robots v3 and @nuxtjs/sitemap v5 I can set Disallow: / in the robots.txt and my sitemap is still generated as expected.

@harlan-zw harlan-zw transferred this issue from nuxt-modules/robots Nov 24, 2024
@harlan-zw
Copy link
Collaborator

This is actually an accidental side effect of how Nuxt Robots is built, as it won't generate the specified robots.txt rules if the site isn't indexable and we need to filter the sitemap URLs by the robot rules.

I could show all routes but then we have an issue where the non-indexable site may list URLs that aren't indexable on production, which leads to a confusing state as well.

Not too sure how to proceed, you could also deploy your app as a production build and then put a htpasswd in front of it if you need to emulate a production environment closer.

@jianbin-lim
Copy link

I have the same problem

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

3 participants