Check a built site
recit- reads the site that recit- wrote and reports what its pages point to
and do not have. It runs on the build, not on the sources: what it sees is what a visitor gets.
Bash
What it checks
-
Links: every
href,src,srcsetandposterof every built page (a page, a stylesheet, an image, a data file such as a CSV or a JSON) must land on a file of the build./guidefindsguide,guide/orindex.html guide.html, as the host serves them. -
Anchors: the
#fragmentof a link must name anid(or aname) of the page it lands on.#topalways counts. The fragment of a link to a file that is not a page (file.) is not checked.pdf# page= 2 -
Accessibility, with
--a11y: axe runs on every built page, served on a local port in Chromium, and each violation (its rule, impact and elements) enters the report.
External addresses (https://…, mailto:) are never fetched. A root address outside the site's
basePath belongs to another site of the same host and is skipped. Addresses in scripts, styles and
comments are not read.
Options
| Option | What it does | Default |
|---|---|---|
--out <folder> | The build folder to read | dist/, else .vercel/ |
--base- | The site's basePath: the pages are read under dist/ and root addresses lose it (/docs) | the basePath of recit.config |
--no-links | Skip the link check | — |
--no-anchors | Skip the anchor check | — |
--a11y | Run axe on every page (Playwright and axe-core installed in the site) | — |
--json | Print the report as JSON on stdout | — |
The command exits with code 1 when it finds a problem, so a continuous integration step fails on a broken link:
Bash
The JSON report lists the number of pages read and each problem with its kind (link or anchor),
the page that holds it and the address as the page writes it:
JSON
With --a11y, the report gains accessibility, one entry per violation:
JSON
Accessibility with axe
Récit's site framework does not ship a browser. --a11y uses the Playwright and the axe-core of the
site, as the PDF export does:
Bash
Without them, the command stops and names what to install.
In continuous integration
A GitHub Actions workflow that fails on a broken link or an axe violation:
YAML