-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix url on whitepaper page to properly access whitepaper pdf [fixes #11918] #11928
Conversation
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This didn't fix it at all |
I've spent a couple hours running around in circles trying to figure this out the best answer I've got is that its related to the locale URLs for the website, if you remove /en/ from the url you can access the PDF with no issue (https://ethereum.org/content/whitepaper/whitepaper-pdf/Ethereum_Whitepaper_-_Buterin_2014.pdf) vs (https://ethereum.org/en/content/whitepaper/whitepaper-pdf/Ethereum_Whitepaper_-_Buterin_2014.pdf). I'll maybe try again to fix this tomorrow but I can't figure it out at the moment |
I'd also like to note that in the current dev branch of this repo this issue is non existent in the dev build ( |
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.
Hey @lucas-amberg!
Just one tiny change right now, but the main issue still stands.
@pettinarip to amend the above comments made by @lucas-amberg: I believe this has to do with how NextJS is interpreting the URL. If I were to move the pdf file to the assets
folder, change the link in question to /assets/Ethereum_Whitepaper_-_Buterin_2014.pdf
, and remove the isInternalPdf
check in the Link
component then the loading of the file works as expected.
Because we are using the content
folder as an entry point for markdown files to be used as pages, Next is assuming the link in question is also just another page.
I do not have a solution at this time aside from moving the pdf to another folder like assets
. Creating a redirect in a middleware file wasn't working when I tried it.
Co-authored-by: Tyler Pfledderer <[email protected]>
@wackerow @pettinarip with the new change to the link the 404 still occurs here if a language code exists in the URL. Tried Arabic with I still think Next is interpreting the link as a page because of the language code existing in URL, and can't recognize it as an asset link. (In other words, there are no folders in the |
Thanks for the PR @lucas-amberg @TylerAPfledderer hmm interesting point. However, I don't see how this is happening. We specify all possible slugs in Meanwhile, I'm disabling the locale prefix with |
Agreed. I haven't dug further into this yet. |
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.
LGTM
Congrats, your important contribution to this open-source project has earned you a GitPOAP! Be sure to join the Ethereum.org discord if you are interested in contributing further to the project or have any questions for the team. GitPOAP: 2024 Ethereum.org Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |
Description
Altered the URL on the whitepaper page to to access the PDF directly
Related Issue
fixes #11918