gatsby: [www]: Fix broken internal links
I did a sweep of the site to try and amend issues with broken links, running a link checker gave me a report of about 300 broken links (some are redundant and show up on multiple pages, see the gist for full output).
The links to fix are the following:
Broken URLs
- https://www.gatsbyjs.org/packages/gatsby/src/utils/create-content-digest.js (HTTP_404)
- https://www.gatsbyjs.org/docs/gatsby-in-the-enterprise/ (HTTP_404) - (this appears to be broken in the sidebar of all docs pages because of a
createRedirect
in/src/www/gatsby-node.js
that is unnecessary, removing it seems like it would be enough to fix all of these issues) - https://www.gatsbyjs.org/packages/gatsby/ (HTTP_404)
- https://www.gatsbyjs.org/plugins/gatsby-transformer-remark (HTTP_404)
- https://www.gatsbyjs.org/offline (HTTP_404)
- https://www.gatsbyjs.org/docs/gatsby-vendor-partnership/gatsbyjs.org (HTTP_404)
- https://www.gatsbyjs.org/docs/mdx/programmatically-creating-pages/api-reference/options/extensions (HTTP_404)
- https://www.gatsbyjs.org/contributing/events/meenhacks.github.io (HTTP_404) - (this looks it’s being interpreted as a relative url, not an absolute url)
You can search for the links above in the gist that has the full output and find the actual pages they are found on, example:
Searching for https://www.gatsbyjs.org/packages/gatsby/src/utils/create-content-digest.js
will find this block in the report:
Getting links from: https://www.gatsbyjs.org/docs/node-interface/
├─BROKEN─ https://www.gatsbyjs.org/packages/gatsby/src/utils/create-content-digest.js (HTTP_404)
├───OK─── https://www.gatsbyjs.org/packages/gatsby-source-drupal/
├───OK─── https://www.gatsbyjs.org/packages/gatsby-source-hacker-news/
├─BROKEN─ https://www.gatsbyjs.org/docs/gatsby-in-the-enterprise/ (HTTP_404)
Finished! 314 links found. 310 excluded. 2 broken.
Showing that the link came from /docs/node-interface/
and there are two broken links on the page, two that are okay, and 310 others that were excluded.
Missing/Broken Images
There are a whole bunch of missing images and things as well, for sake of keeping this issue shorter I’m including them in another gist: https://gist.github.com/gillkyle/72599d04202908c4a7e6cc9b1d359b38
Steps to Complete
We need to go through each of these links on a somewhat case by case basis and find the pages it’s linked from that need updates in code. For images, some are missing, other might just be pointing at the wrong place. For pages, it’s likely that the links have changed or pages have moved and have broken links.
If we can resolve the links that are broken we’ll be in good shape helping newcomers navigate the docs better 👍
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 27 (27 by maintainers)
Commits related to this issue
- docs(www): Fix broken links in https://www.gatsbyjs.org/docs/headless-cms/ Fix broken links in page - https://www.gatsbyjs.org/docs/headless-cms/ Task from issue: [www]: Fix broken internal links... — committed to gatsbyjs/gatsby by luisFilipePT 5 years ago
- docs(www): Fix broken links in sourcing from headless-cms guide (#15133) * docs(www): Fix broken links in https://www.gatsbyjs.org/docs/headless-cms/ Fix broken links in page - https://www.gatsbyj... — committed to gatsbyjs/gatsby by luisFilipePT 5 years ago
- Removed the createRedirect as mentioned in 2nd task of #14693 — committed to kindavishal/gatsby by kindavishal 5 years ago
I would like to help fix this.
Thanks @kindavishal! Since @kkaramch sounded like he was interested in working on it too I don’t think I can give a full green light, but this would be a valuable addition so if there’s a piece you’d like to contribute or a handful of links you’d like to clean up these fixes could even come in multiple PRs from you two (and possibly others) and would be greatly appreciated!
Landed my first PR, took some homework, but was able to figure out! Thanks @watadarkstar and @gillkyle
@tom-raley the broken images on blog posts were fixed by upgrading
gatsby-remark-image
in this PR: https://github.com/gatsbyjs/gatsby/pull/14716 (which I forgot to reference, thanks for the reminder!)If there are other existing links you can find it’s been pretty first come first serve since these changes can be made pretty fast so if no one else has opened up a PR for something feel free to.
It might be a good idea to run the link checker again and get a new dump of broken links to check.
Thanks @luisFilipePT!! Of course we don’t mind, every contribution is totally welcome! 😄
Sounds great @kindavishal! If you have any problems feel free to reach out!
Hi guys, can I give a ✋ ?
“https://www.gatsbyjs.org/docs/gatsby-in-the-enterprise/ (HTTP_404) - (this appears to be broken in the sidebar of all docs pages because of a createRedirect in /src/www/gatsby-node.js that is unnecessary, removing it seems like it would be enough to fix all of these issues)” - This one I cannot reproduce, maybe its already fixed?
“https://www.gatsbyjs.org/contributing/events/meenhacks.github.io (HTTP_404) - (this looks it’s being interpreted as a relative url, not an absolute url)” - @gillkyle you are correct, but looking at the code this is better to be fixed in the CMS, right? The correct link is https://meenhacks.github.io/
I can also make a fn to guarantee that all links are absolute in this list but I don’t know if thats intended.
Cheers
@gillkyle, @kkaramch is on vacation but I’ll check in with him. 👍
@watadarkstar oh yeah you’re right my bad, I guess only users with push access to a repo can be assigned, didn’t know that until now 🤷♂ this conversation is enough to let other’s know that that little bit is already being worked on.
Awesome thanks, @kkaramch and @watadarkstar! That would be super helpful! Would you like to assign yourselves to the issue?
Any help with some or all of the broken links would be very appreciated 🙂
I think the most impactful change is removing the
createRedirect
here, most of the broken links in the report are happening there because the/gatsby-in-the-enterprise
page is linked from the sidebar and trying to redirect to another page that doesn’t exist.