p5.js-website
p5.js-website copied to clipboard
Fix: Remove trailing slashes from external URLs to prevent 404 errors
Fixes #878
Description
Wikipedia and other external links were breaking with 404 errors due to Astro's trailingSlash: "always" config which was appending slashes to all URLs.
Changes
- Modified middleware to remove traling slashes from external URLs (except root domains like
https://example.com/) - Make sure that the middleware runs for all locales, including the default English local
https://github.com/user-attachments/assets/bd37cdca-5fc3-4ff1-bc06-85b53774ec06