Ferrolink 0.2, a link checker for static sites
Catch broken links before they go live.Check the build your visitors will get.
Documentation sites and blogs are built into a folder of HTML pages, images and scripts, and every page points at others. Rename a page or reword a heading, and some of those pointers lead nowhere. Ferrolink reads the finished folder and checks every link, asset and anchor against the files that are really there, without starting a server or making network requests. For documentation sites, static site generators, and CI deployment checks.
- 3 kindsof issue: a missing file, a missing anchor, a link outside the site’s path
- Offlinelinks to other hosts are counted, never fetched
- CLI, Node.js, Viteone native checker behind all three
- Rust 1.96+Apache-2.0; the npm package runs on Node.js 20.19+ or 22.12+
A finished site is a folder of pages that point at each other.
Documentation and blogs are often built by a static site generator: a program that turns Markdown into a folder of HTML pages, images and scripts. A host such as GitHub Pages or Netlify then serves that folder as it is. Every page in it points at others: a link to the next chapter, an image, a stylesheet, a jump to a heading further down.
Rename a page, reword a heading or move the site under a new path, and some of those pointers lead nowhere. A visitor gets an error page, an empty frame where an image should be, or the top of a long page instead of the section they wanted. The Markdown sources cannot tell you all of this, because the generator decides the final file names and addresses. Ferrolink reads the finished folder and checks each reference against the files that are really there.
- Links and assets
- Every address a page points at: links, images and responsive images, scripts, stylesheets, video posters, embedded frames and the preview image a social network shows.
- Anchors
- The part after the #. It must name an element on the target page, so a link lands on the section it promises.
- The site’s path
- On a site served under a folder such as /docs/, a link that forgets the folder works on your laptop and fails online.
- Deployment files
- Ardo’s versions.json and the redirect rules in _redirects and vercel.json, whose destinations are links too.
Three small mistakes. One failed check.
A missing anchor, a missing image and a link that forgets the site’s path. Switch between the same page before and after the fix.
Each issue names the file and line it was found on, what is wrong and the reference as it was written. In a pipeline, that is enough to stop the deployment: the command line exits with 1 when it finds issues, and the Vite plugin fails the build. The page below sits on a site served under /docs/, so a link to /guide/setup leaves it, however right it looks.
<!doctype html><title>Example</title><a href="/docs/guide/setup#installation">Install</a><img src="/docs/assets/preview.svg" alt="Preview"><a href="/guide/setup">Guide</a><a href="https://example.net/">External</a>
index.html
- line 3 · missing anchor
/docs/guide/setup#installation - line 4 · broken link
/docs/assets/preview.svg - line 5 · outside base
/guide/setup
Counted, from report.summary
- two pages checked
- three references inside the site
- one external URL, not fetched
Real output of the ferrolink npm package 0.2.2, checked with siteUrl: "https://example.org/docs/". The build also holds guide/setup.html and assets/logo.svg.
Show the other files of the build
<!doctype html><title>Setup</title><h1 id="install">Install</h1>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6"/></svg>
Checked the way your host will serve it.
A link to /guide can mean guide.html, a folder’s index.html or nothing at all. Ferrolink follows the rules that static hosts share.
GitHub Pages, Netlify, Cloudflare Pages and most static servers agree on how an address becomes a file. An address that ends in a slash serves the folder’s index.html. Any other address serves the exact file if there is one, then the same name with .html, then a folder’s index.html. Ferrolink resolves every reference by the same rules, so it finds what a visitor would find.
Names are compared exactly, as on those hosts, even when your own disk would let a wrong capital letter pass. Give Ferrolink the site’s public address, and links that spell out your own host, such as a canonical link, are checked like any other path. Here is one page with eight links, checked against a build of three files.
/docs/guidefound/docs/guide.htmlfound/docs/blog/found/docs/blogfoundhttps://example.org/docs/blog/found/docs/Guidebroken link/docs/guide/broken link/guideoutside base
Real output of the ferrolink npm package 0.2.2. The build holds index.html, guide.html and blog/index.html, and every link stands on index.html.
Old versions stay online. Their links need rules.
Documentation keeps earlier versions next to the current one. Ferrolink can leave an archive alone, accept a version that lives elsewhere, and still check what your host is told to serve.
An archived version was correct when it shipped, and nobody will edit it again. Its links may point at pages that have moved on since. A check that fails on every old page teaches a team to stop reading the check, so Ferrolink offers two separate choices. exclude skips the links inside matching pages, while links into them still have their anchors checked. assumePresent accepts links to paths that are deployed separately, without looking for them in the build.
The files that steer a host count as well. A redirect to a page that no longer exists sends visitors to an error just like a broken link does. Switch between the three checks below: with both rules in place, one issue is left, the redirect in _redirects to /v2/api/, a page the build does not have.
const report = await check({root: "site",});
_redirects
- line 3 · broken link
/v2/api/
v1/index.html
- line 3 · broken link
/v1/api/
versions.json
- line 11 · broken link
/v0/
Real output of the ferrolink npm package 0.2.2, on a copy of the build below in a temporary folder. Version 2 is current, version 1 is an archive with an old link, and version 0 is listed in versions.json but deployed somewhere else.
Show the build’s files, versions.json and _redirects
_redirectsv1/index.htmlv2/guide/index.htmlv2/index.htmlversions.json
{"current": "v2","versions": [{"path": "/v2/"},{"path": "/v1/"},{"path": "/v0/"}]}
/latest/* /v2/:splat 301/start /v2/guide/ 301/api /v2/api/ 301
Audit search signals in the finished build.
Catch missing sitemap targets, conflicting canonicals, and sitemap URLs blocked by robots.txt or marked noindex.
Run ferrolink audit with the Rust CLI and the public URL of the build. Include the deployment path if the site lives under a folder such as /ardo/. JSON reports give CI a rule ID, file, and line for each finding.
Audit a build in CI
ferrolink audit build/client \
--site-url https://example.org/ardo/ \
--format json✓ Supported · — Gap
Scroll sideways for more columns.
| Capability | Ferrolink | Search Quality Kit |
|---|---|---|
| Build and navigation | ||
| Audit static builds offline | Supported | Supported |
| Native Rust audit binary | Supported | Gap |
| Check local link and asset targets | Supported | Supported |
| Check cross-page fragments | Supported | Gap |
| Check redirect and deployment files | Supported | Gap |
| Check static reachability from entry points | Supported | Gap |
| Find pages with zero incoming links | Gap | Supported |
| Sitemaps and indexing | ||
| Validate XML sitemaps and indexes | Supported | Supported |
| Discover sitemaps via robots.txt | Supported | Supported |
| Detect missing static files listed in sitemaps | Supported | Gap |
| Validate sitemap lastmod | Supported | Supported |
| Detect missing or multiple canonicals | Supported | Supported |
| Detect sitemap and canonical mismatches | Supported | Supported |
| Detect HTML noindex in sitemap entries | Supported | Supported |
| Detect noindex in HTTP headers | Gap | Supported |
| Detect robots.txt blocks on sitemap URLs | Supported | Supported |
| Validate robots.txt syntax | Gap | Supported |
| Page checks | ||
| Validate HTML hreflang codes and return links | Supported | Supported |
| Check titles and meta descriptions | Supported | Supported |
| Validate Open Graph metadata | Gap | Supported |
| Validate embedded JSON-LD syntax | Supported | Supported |
| Check Schema.org and rich-result requirements | Gap | Supported |
| Find exact content duplicates | Gap | Supported |
| Flag HTML, accessibility, and performance issues | Gap | Supported |
| Check llms.txt and declarative WebMCP | Gap | Supported |
| HTTP and CI | ||
| Crawl a live origin | Gap | Supported |
| Detect HTTP redirect chains and loops | Gap | Supported |
| Report JSON with stable rule IDs | Supported | Supported |
| Write SARIF reports | Gap | Supported |
| Gate on new findings against a baseline | Gap | Supported |
| Review and expire suppressions | Gap | Supported |
| Provide a ready-made GitHub Action | Gap | Supported |
Ferrolink coverage describes the source tree. Audit CLI and comparison sources
Two regular expressions read every page.
Ferrolink needs three things from a page: the addresses it points at, the anchors it offers and its base address. It never builds the page the way a browser does.
A browser turns HTML into a tree of elements before it shows anything, and a full HTML parser does the same work. A link checker needs a small part of it: the attributes that hold addresses, every id, and the first <base>. Ferrolink finds the files of the build with Ferralk, a glob matcher and file walker, and reads the pages in parallel with Ferroni, a regex engine. One expression finds comments and start tags, a second splits the attributes of the tags that matter.
That choice was measured against three HTML tokenizers on the same pages. On one thread, the regular expressions read them fastest. On all cores the whole check also spends its time finding files and checking references, and the gap closes: html5gum finished slightly ahead. Ferroni stayed, because it is the engine the family builds, so every check Ferrolink runs also tests it.
Time for the same pages
Ferroni = 1×, the line through every row. A bar past it took longer, a shorter bar less time.
The full comparison also covers broken markup, how the patterns were tuned and three fixes to Ferroni that came out of it. Every table, its method and its limits
Show the figures as a table
| Task | Scanner | Time | Relative |
|---|---|---|---|
| Read every page, one thread | Ferroni | 50.6 ms | 1× |
| Read every page, one thread | html5gum | 61.1 ms | 1.21× |
| Read every page, one thread | lol_html | 73.3 ms | 1.45× |
| Read every page, one thread | html5ever | 129 ms | 2.55× |
| The whole check, all cores | Ferroni | 24.8 ms | 1× |
| The whole check, all cores | html5gum | 23.7 ms | 0.96× |
| The whole check, all cores | lol_html | 30.1 ms | 1.21× |
| The whole check, all cores | html5ever | 35.4 ms | 1.43× |
The price is known and small for generated pages. On markup with an unclosed quote, the expressions pick up at the next tag where a browser would not, and they decode only the character references that occur in addresses. On both builds of the Ardo documentation that were measured, every scanner reported the same issues.
A build check, not a crawler.
Ferrolink is a link checker for static sites. It checks page links, asset references and anchors in static HTML builds, without a server or network requests. It reads what your build wrote and leaves the internet alone: links to other hosts are counted, never fetched.
- On the command line
cargo install --locked ferrolink, thenferrolink check distafter any static site generator. JSON output is there for CI annotations.- In Node.js
npm install --save-dev ferrolinkbrings a prebuilt native binary for macOS, Linux and Windows, without a Rust toolchain. It needs Node.js 20.19+ or 22.12+.- In a Vite build
- The plugin checks the finished client output once the build is complete and fails the build when it finds issues, or only warns if you ask.
- In Ardo
- Ardo, a documentation framework for React, runs its link check on Ferrolink.
- Not included
- Fetching external addresses to see whether they are online, running a page’s JavaScript, or validating HTML against the full standard.
- License
- Apache-2.0, for the command line, the library and the npm package.
The JavaScript API and the Vite plugin are the supported contract; the Rust library serves the command line and the npm package and can change in any minor release. This website is checked by Ferrolink on every build.
HTML connects pages through links and anchors. Ferrolink checks those references against the finished build using browser-style URL resolution and static-host file routing, including deployment paths and redirect destinations. It is one of the Ferramenta engines, made by Sebastian Software in Mainz, Germany.
Check the build before it goes live.
Add the Vite plugin to stop a broken build, or run the command line after any static site generator. Both read the folder your build already wrote.
GitHub repositoryDocumentationNode.js and Vite referenceIntegration and support