Feature(sitemap): named files chunking strategy#1
Merged
Conversation
Adds the ability to split sitemap generation into chunks based on customizable logic. This allows for better management of large sitemaps and improved performance. The new `chunks` option in the sitemap configuration allows users to define functions that categorize sitemap items into different chunks. Each chunk is then written to a separate sitemap file. This change introduces a new `writeSitemapChunk` function to handle the writing of individual sitemap chunks.
Adds a `chunks` option to the sitemap configuration schema. This allows users to define custom chunking strategies for generating sitemaps, providing flexibility in how the sitemap is split into multiple files.
The empty callback function in the `writeSitemap` function was causing unnecessary function calls. This commit fixes this by removing the empty callback.
This commit adds a test fixture to verify the sitemap chunking functionality. It includes a configuration file, dependencies, and several pages to simulate a real-world scenario.
Adds changeset to document the new sitemap chunking feature. This feature allows splitting sitemap generation into chunks based on customizable logic, improving management of large sitemaps and performance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
What does this change?
Be short and concise. Bullet points can help!
Before/after screenshots can help as well.
Don't forget a changeset! Run
pnpm changeset.See https://contribute.docs.astro.build/docs-for-code-changes/changesets/ for more info on writing changesets.
New sitemap optional configuration for named sitemap files chunking strategy
Adds a chunks option to the sitemap configuration schema.
This allows users to define custom chunking strategies for
generating sitemaps, providing flexibility in how the sitemap
is split into multiple files.
Testing
Docs
yes, to add optional configurations for the chunks
cc @withastro/maintainers-docs for feedback!