-
Notifications
You must be signed in to change notification settings - Fork 167
Fix: remove trailing slashes from broken Wikipedia links #892
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?
Conversation
Few unrelated tests (CodeEmbed.test.tsx, CodeFrame.test.tsx) failed due to a known syntax error ( All reference and documentation pages were successfully built and verified locally. |
It looks like your change is to use old versions of two packages. I'm guessing the add-a-slash behavior was introduced in their newer versions? |
Hi @blackboxlogic thank you for the feedback! |
Look at your changed files, note that the first one included two package downgrades. I wonder if you made manual updates to generated files, which I think would be an oops. I'm not familiar with this project, are you? |
@blackboxlogic You're absolutely right, I initially didn't intend to change any dependencies, but I just noticed that I’ve now restored the original versions: This PR only contains content fixes now, with no dependency changes. Thanks again for pointing this out! |
My question remains about if you made manual edits to generated content (removing all the slashes). I suspect the files you edited are the output from an automated process and changing them directly (while easy) is wrong. But I'm not familiar with this project. |
Also acknowledging that you're a stranger on the Internet who is trying to fix a problem and I appreciate that, and maybe you're familiar with this project and your change is correct and I shouldn't be so dismissive. |
Thanks again, @blackboxlogic. |
This doesn't quite fix the problem as the contributor docs and reference pages are all generated content from their original in the p5.js repo. The original sources don't have trailing slashes on the links. The trailing slashes are added to enable relative links to work as expected in local development, which means they should not apply to absolute links such as wikipedia links. Without changing the adding slashes logic, the changes here will be replaced on next build. Therelevant changes needed are in There shouldn't be changes to |
Thanks for the clarification @limzykenneth. |
Hi @limzykenneth, @blackboxlogic , I wanted to provide an update on this issue. What I have tried so far:
Despite these efforts, the trailing slash persists on absolute Wikipedia URLs in the built site. Possible causes:
I would appreciate any guidance or suggestions on where else I could look or how to properly fix this at the source. Thanks |
Just a quick check @reshma045, are you rebuilding with |
Yes @davepagurek, I’ve been running |
Hi @reshma045, sorry I wasn’t involved in the earlier conversation and only just saw a few comments on this PR. I think I understand the issue you’re facing. I tried making the changes myself and got the correct results.
I believe the changes you’re making might not be correct. When you update the r A very nice clean solution might me for this problem would be.
In that new PR, just change the file src/scripts/builders/reference.ts (since utils files doen't generate the reference? @limzykenneth). Once, you updated the file, you just need to run Review the changes by launching the site locally, and if everything looks good, push them in the new PR. If the changes in the reference.ts still doesn't genereates the correct output, probably you can share me the changes you did, I can help on that. Thanks for your help on this :) |
Hi @perminder-17, thank you for the detailed explanation. I’m still relatively new to the codebase and have learned a lot from your guidance. I’ll open a fresh PR, update only |
Sure, feel free to share the changes if it doesn't works. |
Hi @perminder-17, I've created a new PR with all the suggested changes for the issue. Please check #934. Thank you. |
Description:
This PR fixes issue #878 by removing unnecessary trailing slashes from Wikipedia links across the p5.js website and documentation. Trailing slashes on some Wikipedia URLs were causing 404 errors.
Issue: Fixes #878
Changes:
Removed trailing slashes from all
wikipedia.org/wiki/
links found using a site-wide search.Example Fixed Link:
Before: https://en.wikipedia.org/wiki/Screen_reader/ (404)
After: https://en.wikipedia.org/wiki/Screen_reader (Works (HTTP 200))
Verification:
http://localhost:4321