fix(seo): resolve sitemap indexing issues (fixes #107) #164
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.

Bug Fix: Sitemap Indexing Issue
Problem
The user reported that Google Search Console cannot index
sitemap.xml.Investigation revealed two potential issues:
buildscript rannext buildbeforenpm run generate:sitemap. This meantpublic/sitemap.xmlwas copied to the deployment folder (out/) before being updated. The deployed sitemap was always one version behind.sitemap-generator.jsscript appended blog routes toroutes.json every run. Repeated runs caused duplicate entries inroutes.jsandsitemap.xml, which could invalidate the sitemap or confuse crawling.Changes Applied
1. Updated
package.jsonModified the
buildscript to generate the sitemap before building the Next.js app."build": "next build && npm run generate:sitemap""build": "npm run generate:sitemap && next build"This ensures the
outdirectory contains the latestsitemap.xmlcopied frompublic.2. Updated
scripts/sitemap-generator.jsroutes.jsandsitemap.xmlonly contain unique paths, preferring the latest data fromblogsArray../outif the directory exists. This handles cases where the script is run manually after a build.How to Verify
npm run build.out/sitemap.xml(or deployed URL) to confirm it matchespublic/sitemap.xml.routes.jsto ensure no duplicate blog entries exist.