GRA-164: adds /docs to sitemap #75
Open
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.
https://linear.app/grapesjs/issue/GRA-164/add-sitemap
Updating Sitemap to include /docs pages
Changes:
Fetches the docs sitemap: Retrieves https://grapesjs.com/docs/sitemap-index.xml (https://github.com/GrapesJS/grapesjs/pull/6648/files) at build time
Handles sitemap indexes: If it's a sitemap index (references other sitemaps), it fetches and parses all referenced sitemaps
Parses XML: Extracts all URLs with their lastmod dates from the XML
Includes in main sitemap: Adds all docs URLs with:
Priority: 0.6
Change frequency: daily
Last modified: from the docs sitemap
The sitemap now includes:
Static pages
Comparison pages
Blog posts
All docs pages (open source and SDK docs from the other repo)
During next build, it fetches the docs sitemap and includes all those URLs in the generated sitemap.xml. The fetch is cached for 24 hours (revalidate: 86400) to avoid hitting the docs site on every build.