DEV Community

Cover image for Validating your site's links in a world of SSR and server components
James O'Halloran
James O'Halloran

Posted on

Validating your site's links in a world of SSR and server components

Over the last 5 years, I have loved working in the "Jamstack" movement, where static site generators (like Hugo, Jekyll, Gatsby, etc) pre-generated your HTML for you, and your pages were served from a CDN. Validating links before pull-requests were merged was easy, because all your checks could run against this pre-generated HTML

Lately though, with popular frameworks like NextJS, Remix, and the whole shift to Server Components, more of the modern web if shifting back to server-side rendering. It's becoming harder to do these checks BEFORE pull-requests are merged.

This is why I built LinkProofer, an extremely lightweight CLI tool for validating links stored in js or ts files.

linkproofer

Instead of proofing the links in the built-html, it proofs them before they are consumed.

✨ Features

  • Out-of-the-box Typescript support.
  • Customizable entry (Provide your own filepath glob, or store links in *.linkproof.<js | ts> files).
  • Support for absolute or relative links.
  • Run LinkProofer checks locally, or in CI.
  • Lightweight! (~50 kB).

You can learn more about the project by checking out the GitHub repository

Top comments (0)