Link Validation
Find broken links at build time.
After the build, this plugin checks the links on your prerendered pages, and a broken link fails the build:
In "/docs/getting-started": link "/docs/missing-page" not-foundAdd the plugin:
import { linkValidationPlugin } from "fumapress/plugins/link-validation";
createPress(content).plugins(linkValidationPlugin());It checks links in Fumadocs layouts and your content. On custom pages, use Link from fumapress/client, since a plain <a> isn't tracked.
Ignored and External Links
Full URLs are skipped by default. Use these options to skip more links, or to check full URLs too:
linkValidationPlugin({
ignored(href) {
return href.startsWith("/preview/");
},
});CI Reports
To annotate a pull request instead of parsing an error message, write the results to a file. "json" keeps the build passing, and "both" also fails it.
linkValidationPlugin({
report: "json",
});An empty list means validation ran and found nothing. Change the file name with diagnosticsPath.
Options
Prop
Type
Last updated on