Skip to content
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

Force /discord/ invite path links to full url #10397

Merged
merged 2 commits into from
Jun 8, 2023
Merged

Conversation

wackerow
Copy link
Member

@wackerow wackerow commented Jun 7, 2023

Description

  • Updates the link component to force links to /discord/ to use the full https://ethereum.org/discord/ path. The former is being treated as an internal link and not triggering the desired redirect until a user refreshes the page at that path. By using the full path, it triggers the proper redirect for the Discord invite link.
  • I saw two options here, one where we require editors to use the full path when linking out to this path, or another where we just add logic to the Link component to check for this relative path (/discord/) and update accordingly.
  • I went with the second option here and have added a check for this path in Link, and then adjusting the string to the full path if it matches.

Thank you to @megatheikal for reporting! And my apologies, this got brought up earlier while going through feedback as a team and I went ahead and put together a patch. It wasn't until now that I noticed your request to work on this, so I do apologize... Didn't mean to steamroll.

Preview link

https://ethereumorgwebsitedev01-discordinvite.gatsbyjs.io/en/contributing/translation-program/how-to-translate/#find-document -> Discord link

Related Issue

@gatsby-cloud
Copy link

gatsby-cloud bot commented Jun 7, 2023

✅ ethereum-org-website-dev deploy preview ready

minimalsm
minimalsm previously approved these changes Jun 8, 2023
Copy link
Contributor

@minimalsm minimalsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM—working as expected now. Thanks @wackerow.


I do wonder if there is a more robust way of dealing with this,

If I understand the problem:

An internal link (e.g. /discord/) with a redirect to an external URL will always have this problem.

So this solves the problem for Discord links, but if we want to use this pattern in the future (e.g. we have ethereum.org/writing-cohort), we'll have to implement a fix for those cases too.

We don't need to invest time into this right now as it solves our immediate need.

@minimalsm minimalsm changed the base branch from dev to staging June 8, 2023 10:31
@minimalsm minimalsm dismissed their stale review June 8, 2023 10:31

The base branch was changed.

@minimalsm
Copy link
Contributor

minimalsm commented Jun 8, 2023

@wackerow, I think we should pull this into staging for the release candidate. I've changed base branch to staging

@minimalsm minimalsm mentioned this pull request Jun 8, 2023
5 tasks
@gatsby-cloud
Copy link

gatsby-cloud bot commented Jun 8, 2023

✅ ethereum-org-website-staging deploy preview ready

@corwintines corwintines merged commit 196ded0 into staging Jun 8, 2023
@corwintines corwintines deleted the discord-invite branch June 8, 2023 19:07
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.

Bug report: Discord link at Get in Touch section on how to translate tutorial is broken
3 participants