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

Merging staging into master broke all existing links #757

Open
bnb opened this issue May 21, 2020 · 11 comments
Open

Merging staging into master broke all existing links #757

bnb opened this issue May 21, 2020 · 11 comments
Labels
bug

Comments

@bnb
Copy link
Member

@bnb bnb commented May 21, 2020

Description

All links prior to merging staging into master are now completely broken since there was no redirect strategy in place. We've marketed nodejs.dev publicly as a way to learn more about Node.js and have now entirely broken all references, nuking the UX of the site for users who are trying to learn.

Expected result

Old backlinks should work.

Actual result

Old backlinks are broken.

@bnb bnb added the bug label May 21, 2020
@tstreamDOTh
Copy link
Contributor

@tstreamDOTh tstreamDOTh commented May 22, 2020

I think we can setup redirects in gatsby, do we have some set of links which are not working?

@designMoreWeb
Copy link

@designMoreWeb designMoreWeb commented May 23, 2020

@benhalverson and I are working on this collaboratively together currently on fixing this

@tstreamDOTh
Copy link
Contributor

@tstreamDOTh tstreamDOTh commented May 23, 2020

@designMoreWeb Let me know if any help needed

@benhalverson
Copy link
Contributor

@benhalverson benhalverson commented Jul 15, 2020

@tstreamDOTh if you want to work on this feel free.

@bnb
Copy link
Member Author

@bnb bnb commented Jul 15, 2020

Honestly feel this this is revert worthy and am sad that it's not been addressed in a meaningful way in 2 months.

@tstreamDOTh
Copy link
Contributor

@tstreamDOTh tstreamDOTh commented Jul 19, 2020

@benhalverson Looking into this

@rachelnicole
Copy link

@rachelnicole rachelnicole commented Jul 21, 2020

Okay, I found this article. Seems like we can add another field in the md files called redirect for each page that includes the old urls like

title: How to log an object in Node.js
description: 'Logging objects in Node.js'
authors: flaviocopes, MylesBorins, fhemberger, LaRuaNa, ahmadawais
section: Getting Started
redirects:
  - /how-to-log-an-object-in-nodejs

and then follow through the rest.

I tried to do it but I couldn't get it to work :/

@adrian-cg
Copy link

@adrian-cg adrian-cg commented Aug 10, 2020

I'd love to help out if this hasn't been sorted out already. I'm struggling with the context for this issue, though. Was there a change in the URL structure so some old links that were published in other sites no longer work? What was the old structure?

@benhalverson
Copy link
Contributor

@benhalverson benhalverson commented Aug 10, 2020

Here's an example.
The old link was http://nodejs.dev/a-brief-history-of-nodejs
The new links have /learn/thing http://nodejs.dev/learn/a-brief-history-of-nodejs

I've tried fixing myself using the gatsby plugins but end up with links like http://nodejs.dev/learn/a-brief-history-of-nodejs/a-brief-history-of-nodejs

@rachelnicole
Copy link

@rachelnicole rachelnicole commented Aug 11, 2020

I'm actually going to pair with someone on this sometime this week.

@marcustisater
Copy link

@marcustisater marcustisater commented Aug 12, 2020

I also tested a few plugins and they don't work very well.

Here is another way you could do it for all of the existing blog posts in gatsby-node.js using createRedirect 🤷‍♂️

  let redirects= [
    { from: `https://nodejs.dev/a-brief-history-of-nodejs`, to: `https://nodejs.dev/learn/a-brief-history-of-nodejs` }
  ]

  redirects.forEach(({ from, to }) => {
    createRedirect({
      fromPath: from,
      isPermanent: true,
      redirectInBrowser: true,
      toPath: to,
    })
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.