Skip to content

fix: improve sitemap generator for better Google Search Console compatibility#363

Merged
mattqdev merged 1 commit into
physicshub:mainfrom
TechGenius-Karan:fix/sitemap-generator
Jun 23, 2026
Merged

fix: improve sitemap generator for better Google Search Console compatibility#363
mattqdev merged 1 commit into
physicshub:mainfrom
TechGenius-Karan:fix/sitemap-generator

Conversation

@TechGenius-Karan

Copy link
Copy Markdown
Contributor

📘 Pull Request Template – PhysicsHub

Thank you for contributing to PhysicsHub!
Please complete the sections below to help us review your pull request efficiently.


🔍 Description

Improves the sitemap generation script to resolve the Google Search Console
indexing issue (#107):

  • Removes unused XML namespaces (news, xhtml, image, video) that were
    declared but never used — these can confuse crawlers
  • Adds <lastmod> dates to all URLs (blog, simulation, and static routes)
  • Adds explicit <?xml version="1.0" encoding="UTF-8"?> declaration
  • Uses path.join() + __dirname for correct cross-platform file paths
  • Ensures public/ directory exists before writing (defensive)
  • Simplifies out/ directory handling using existsSync (removes dynamic imports)
  • Adds process.exit(1) on failure so CI fails visibly if sitemap errors
  • Adds summary output for verification

This replicates the approach from PR #290 with Prettier formatting applied.

✅ Checklist

  • I have read the CONTRIBUTING.md
  • My changes follow the code style of this project
  • I ran npm run format — Prettier passes on the changed file
  • No new ESLint errors introduced

🎨 Visual Changes

No UI changes — build script only.

📂 Type of Change

  • Bug fix

🧩 Additional Notes for Reviewers

This is a re-implementation of PR #290 which the maintainer said would be merged
if prettier errors were fixed. Prettier has been applied and the file passes
npx prettier --check scripts/sitemap-generator.js. The current file also
includes the simulationRoutes (added after #290 was opened), which have been
given lastmod dates as well.

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@TechGenius-Karan is attempting to deploy a commit to the PhysicsHub's projects Team on Vercel.

A member of the Team first needs to authorize it.

@mattqdev mattqdev merged commit 98b81e1 into physicshub:main Jun 23, 2026
1 of 2 checks passed
@physicshub

Copy link
Copy Markdown
Owner

🎉 This PR is included in version 3.29.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants