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

gatsby-plugin-sitemap default output does not comply with spec and Google #34811

Closed
2 tasks done
don-esteban opened this issue Feb 14, 2022 · 7 comments · Fixed by #36812
Closed
2 tasks done

gatsby-plugin-sitemap default output does not comply with spec and Google #34811

don-esteban opened this issue Feb 14, 2022 · 7 comments · Fixed by #36812
Labels
topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label
Milestone

Comments

@don-esteban
Copy link

Preliminary Checks

Description

gatsby-plugin-sitemap default output option generates sitemaps in the folder /sitemap. The spec says about sitemap location:

The location of a Sitemap file determines the set of URLs that can be included in that Sitemap. A Sitemap file located at http://example.com/catalog/sitemap.xml can include any URLs starting with http://example.com/catalog/ but can not include URLs starting with http://example.com/images/.

Google says:

A sitemap can be posted anywhere on your site, but a sitemap affects only descendants of the parent directory. Therefore, a sitemap posted at the site root can affect all files on the site, which is where we recommend posting your sitemaps.

Reproduction Link

https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-sitemap#options

Steps to Reproduce

Use the plugins default configuration.

  1. https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-sitemap#options

Expected Result

The path should be /

Actual Result

The path is /sitemap

Environment

System:
    OS: macOS 12.1
    CPU: (16) x64 Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
    npm: 8.3.0 - ~/.nvm/versions/node/v14.18.1/bin/npm
  Languages:
    Python: 2.7.18 - /usr/bin/python
  Browsers:
    Chrome: 98.0.4758.80
    Firefox: 97.0
    Safari: 15.2
  npmPackages:
    gatsby: ^4.5.4 => 4.6.0 
    gatsby-image: ^3.11.0 => 3.11.0 
    gatsby-plugin-fontawesome-css: ^1.2.0 => 1.2.0 
    gatsby-plugin-manifest: ^4.6.0 => 4.6.0 
    gatsby-plugin-mdx: ^3.5.2 => 3.6.0 
    gatsby-plugin-react-helmet: ^5.6.0 => 5.6.0 
    gatsby-plugin-root-import: ^2.0.8 => 2.0.8 
    gatsby-plugin-sass: ^5.5.0 => 5.6.0 
    gatsby-plugin-sharp: ^4.5.2 => 4.6.0 
    gatsby-plugin-sitemap: ^5.6.0 => 5.6.0 
    gatsby-remark-autolink-headers: ^5.5.0 => 5.6.0 
    gatsby-remark-copy-linked-files: ^5.5.0 => 5.6.0 
    gatsby-remark-images: ^6.5.2 => 6.6.0 
    gatsby-remark-normalize-paths: ^1.1.0 => 1.1.0 
    gatsby-remark-responsive-iframe: ^5.5.0 => 5.6.0 
    gatsby-remark-smartypants: ^5.5.0 => 5.6.0 
    gatsby-source-filesystem: ^4.5.2 => 4.6.0 
    gatsby-transformer-sharp: ^4.6.0 => 4.6.0 
    gatsby-transformer-yaml: ^4.6.0 => 4.6.0 
  npmGlobalPackages:
    gatsby-cli: 4.7.0

Config Flags

No response

@don-esteban don-esteban added the type: bug An issue or pull request relating to a bug in Gatsby label Feb 14, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 14, 2022
@marvinjude marvinjude added topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label and removed type: bug An issue or pull request relating to a bug in Gatsby status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Feb 15, 2022
@marvinjude
Copy link
Contributor

marvinjude commented Feb 15, 2022

Hi @don-esteban,

Thanks for reporting this issue. We'll probably change the defaults here in an upcoming major release. For now, I believe passing your desired option should work well for you.

@acidicX
Copy link

acidicX commented Feb 24, 2022

I've just seen this as well, makes absolute sense to change the default. I also had to set the option to / explicitly.

@don-esteban
Copy link
Author

don-esteban commented Feb 24, 2022

I would like to suggest an intermediate solution. Updating the docs with a highlighted advice. We had for some weeks a broken sitemap (not really broken, but useless) until SEO-people noticed us.

@laurenskling
Copy link
Contributor

So, I was struggling getting a new project indexed. But now I really have a feeling this /sitemap/ folder is causing the hurt. I just changed it to root and submitted it. Just stumbled upon this issue by chance; checking out the issues list. If I didn't end up here by chance I would have never known my sitemaps where broken/useless. This is pretty nasty. We should really consider alerting users using /sitemap/ if it is really hurting the indexing.

@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Mar 31, 2022
@github-actions
Copy link

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

@laurenskling
Copy link
Contributor

I really think this should be reopened. The current defaults make the sitemap useless, with users trusting everything being alright after installing the plugin.

@LekoArts LekoArts removed the stale? Issue that may be closed soon due to the original author not responding any more. label Oct 13, 2022
@LekoArts LekoArts reopened this Oct 13, 2022
@LekoArts LekoArts added this to the Gatsby 5 milestone Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants