-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SEO #6495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
SEO #6495
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements Static Site Generation (SSG) to resolve SEO issues with Google's searchbot by pre-rendering all routes at build time. The previous SPA GitHub Pages hack (from 2016) stopped working in 2019 and was causing all pages to return 404 status codes, preventing indexing.
Key changes:
- Replaced the SPA 404 redirect hack with proper SSG using React's
renderToString
andhydrateRoot
- Added automated sitemap validation to ensure consistency between generated HTML files and sitemap entries
- Created an Examples index page with category previews to replace redirect-only routes
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
www/src/entry-server.tsx | New SSR entry point that renders routes to HTML and exports all routes for pre-rendering |
www/scripts/prerender.tsx | Build script that pre-renders all 378 routes to static HTML files |
www/scripts/validate-sitemap.tsx | Validation script ensuring sitemap URLs match generated HTML files |
www/src/app.tsx | Changed from createRoot to hydrateRoot for SSR hydration |
www/src/views/ExamplesIndexView.tsx | New landing page displaying example categories with preview cards |
www/src/routes/index.tsx | Removed redirect routes, added proper Examples index route |
www/vite.config.ts | Updated sitemap configuration to include explicit locale prefixes |
www/public/404.html | Replaced redirect hack with proper 404 page |
www/index.html | Removed SPA GitHub Pages redirect script |
.github/workflows/deploy-staging.yml | New workflow for staging deployments |
Files not reviewed (1)
- www/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
www/src/routes/index.tsx:17
- The optional parameter
/:name?
allows matching routes without the name segment, but there's no index view defined for the API route. This means accessing/:locale/api
will render APIView with undefined name, which may not be the intended behavior. Consider either making the name parameter required (:name
) or adding a separate route for the API index page similar to how ExamplesIndexView was added for examples.
path="/:locale/api/:name?"
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6495 +/- ##
==========================================
- Coverage 93.64% 93.48% -0.17%
==========================================
Files 429 431 +2
Lines 39021 39090 +69
Branches 4531 4533 +2
==========================================
+ Hits 36540 36542 +2
- Misses 2466 2531 +65
- Partials 15 17 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportBundle size has no change ✅ |
Description
Website only.
Couple of things happened here: