DEV Community

Cover image for Checking a Web Page for Dead Links (A Golang Command-Line Tutorial)

Checking a Web Page for Dead Links (A Golang Command-Line Tutorial)

Niko Heikkilä on November 26, 2019

There is no content on the web that is immune to rotting and growing moss. Blog posts start festering with old dead links pointing to nowhere, and ...
Collapse
 
dylanjha profile image
Dylan Jhaveri

This got me thinking. I would like a tool that does this as part of a CI flow for my statically generated marketing site.

Is there anything out there like that? I imagine others have this problem of occasionally pushing out marketing site changes and unknowingly there are broken links.

Collapse
 
nikoheikkila profile image
Niko Heikkilä

Yes. I build my static blog with Gatsby, which has a sitemap plugin. During a CI pipeline, I iterate over each link in the sitemap and check the pages for accessibility issues using the great pa11y tool. It would be quite trivial to check for broken links as well.

With Github Actions, I presume it would be feasible to make a tool for this and distribute it as a custom action in their marketplace.