Skip to content

Conversation

@saksham-1304
Copy link
Contributor

Adds redirect for legacy newsletter links pointing to /community-news to properly route to /news/community-news page.

Fixes #514

name: Pull Request
about: Submit changes to the Sugar Labs website for review

📝 Description

Adds a redirect from /community-news to /news/community-news to fix broken links from legacy sources (e.g., The Sweet Spot newsletter). Users visiting the old URL will now be automatically redirected to the correct Community News page instead of encountering a 404 error.

🔗 Related Issue

Fixes #[514]

🔄 Type of Change

  • 🐛 Bug Fix

📷 Visual Changes

Screenshots / GIFs

Before:

  • Visiting /community-news resulted in 404 error page
image

After:

  • Visiting /community-news automatically redirects to /news/community-news
  • Shows correct Community News content

🧪TESTED LOCALLY


image

🧪 Testing Performed

📱 Browser Compatibility

  • Chrome (Version: 130)
  • Firefox (Version: 131)
  • Safari (Version: N/A - Windows)
  • Edge (Version: 130)
  • Mobile Chrome (Device: Samsung Galaxy)
  • Mobile Safari (Device: N/A)

🖥️ Responsive Design

  • Desktop (1200px+)
  • Tablet (768px - 1199px)
  • Mobile (320px - 767px)

✅ Test Cases

  1. ✅ Navigate to /community-news - redirects to /news/community-news
  2. ✅ Redirect uses replace navigation (no history entry)
  3. ✅ Target page loads correctly without 404
  4. ✅ Existing redirects still work (/booting-soas, /go/Sugar_Labs/Donate)
  5. ✅ Production build works correctly

♿ Accessibility

  • No changes to accessibility (redirect only)
  • Target page already meets accessibility standards

📋 PR Checklist

  • My code follows the project's coding style guidelines
  • I have tested these changes locally
  • I have updated the documentation accordingly (N/A - no docs needed)
  • My changes generate no new warnings or console errors
  • I have added tests that prove my fix/feature works (N/A - simple redirect)
  • All existing tests pass successfully
  • I have checked for and resolved any merge conflicts
  • I have optimized images/assets (N/A - no assets)
  • I have validated all links are working correctly

💭 Additional Notes

Technical Implementation:

  • Modified src/redirects.tsx to add new entry in redirectMap
  • Follows existing pattern used for other redirects in codebase
  • Uses React Router's <Navigate> with replace prop

Testing Notes:

  • Tested in both dev (npm run dev) and production (npm run build && npm run preview) modes
  • Verified redirect works on initial page load and direct URL access
  • Confirmed no console errors or warnings

Impact:

  • Zero breaking changes
  • Improves user experience for newsletter recipients
  • Maintains SEO by proper redirects vs 404s

Adds redirect for legacy newsletter links pointing to /community-news
to properly route to /news/community-news page.

Fixes #[514]
@github-actions
Copy link

🎉 All Checks Passed!

Status: ✅ Ready to merge

✅ Completed Workflows

Workflow Status Details
🔨 Continuous Integration ✅ Passed Build completed successfully
📝 Code Linting ✅ Passed All formatting and style checks passed

🚀 This PR is ready for review and can be safely merged to main branch!

Great work! Your code meets all quality standards. 👏

@saksham-1304
Copy link
Contributor Author

@pikurasa Please review the PR

@sa-fw-an
Copy link
Member

Good work @saksham-1304 :)

@sa-fw-an sa-fw-an merged commit 95cd6f8 into sugarlabs:main Oct 31, 2025
3 checks passed
@saksham-1304 saksham-1304 deleted the 514-fix-community-news-redirect branch October 31, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redirect https://www.sugarlabs.org/community-news --> https://www.sugarlabs.org/news/community-news

2 participants