gatsby-plugin-sitemap always generates sitemap-index even on low page count
See original GitHub issueDescription
According to documentation gatsby-plugin-sitemap
should only generate sitemap-index when having more entries than entryLimit
option
entryLimit
(number = 45000) Number of entries per sitemap file, a sitemap index and multiple sitemaps are created if you have more entries.
With recent updates (4.0
) this is not the case anymore. sitemap-index.xml
is always generated, which is quite weird for small amount of entries. It is a different problem than the one being solved currently in #31167, but it existence seems related to recent activity.
Steps to reproduce
Branch with reproducible case: https://github.com/ichik/ichik.xyz/tree/sitemap-bug
Expected result
Link to sitemap.xml
generated
Actual result
Link to sitemap-index.xml
generated
Environment
System:
OS: macOS 11.3.1
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
npm: 6.14.13 - ~/.nvm/versions/node/v14.16.1/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 90.0.4430.93
Firefox: 88.0
Safari: 14.1
npmPackages:
gatsby: ^3.4.1 => 3.4.1
gatsby-plugin-humans-txt: ^1.1.4 => 1.1.4
gatsby-plugin-image: ^1.4.0 => 1.4.0
gatsby-plugin-manifest: ^3.4.0 => 3.4.0
gatsby-plugin-mdx: ^2.4.0 => 2.4.0
gatsby-plugin-netlify: ^3.4.0 => 3.4.0
gatsby-plugin-offline: ^4.4.0 => 4.4.0
gatsby-plugin-react-helmet: ^4.4.0 => 4.4.0
gatsby-plugin-robots-txt: ^1.5.6 => 1.5.6
gatsby-plugin-sharp: ^3.4.1 => 3.4.1
gatsby-plugin-sitemap: ^4.0.0 => 4.0.0
gatsby-plugin-styled-components: ^4.4.0 => 4.4.0
gatsby-plugin-typescript: ^3.4.0 => 3.4.0
gatsby-remark-images: ^5.1.0 => 5.1.0
gatsby-remark-unwrap-images: ^1.0.2 => 1.0.2
gatsby-source-filesystem: ^3.4.0 => 3.4.0
gatsby-transformer-sharp: ^3.4.0 => 3.4.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:14 (8 by maintainers)
Top Results From Across the Web
gatsby-plugin-sitemap
Create a sitemap for your Gatsby site. Please note: This plugin only generates output when run in production mode! To test your sitemap,...
Read more >Generate an SEO-Friendly Sitemap for your Gatsby Site
Whenever we build our site, this plugin will generate a sitemap.xml file, alongside all the other files that Gatsby builds.
Read more >Gatsby Plugin Sitemap does not generate sitemap for my ...
The below code doesn't generate sitemap of my Gatsby website. I am using wordpress as my CMS. Any suggestions what I am doing...
Read more >XML Sitemap: key recommendations for optimization
xml on your site can act as good navigation for the pages you want Google bot to index. It helps you find your...
Read more >Gatsby Plugin: Sitemap · A blog by Stephen
entryLimit (number = 45000) Number of entries per sitemap file. A sitemap index (as sitemap-index.xml ) will always be created and multiple ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think that it’s somewhat of an overkill to always generate index in case you might have over 50,000 entries. For a lot of gatsby projects out there previous behavior which resulted in a single sitemap.xml looked way more sensible.
This has been reported and fixed in the next release.