NAME

App::Dapper::Check - Find the problems in a site without publishing it.

DESCRIPTION

dapper check builds the site into a temporary directory, collecting every problem instead of stopping at the first, then looks for links between pages that lead nowhere. The real output directory is not touched.

$ dapper check
$ dapper check --json

It reports:

  • front matter that can't be read, or that doesn't match a _schema.yml

  • layouts that don't exist, and errors in templates

  • two pages that would be written to the same file

  • links and images (href and src) inside the site that lead to no file

  • settings that need url when it isn't set, and pages without a title

  • images without alt text, skipped heading levels, pages with no language, and links with no text or only "click here" (see "quality")

  • missing, duplicate or overlong titles and descriptions

With --json, the report is printed as JSON, for scripts and AI assistants:

{
  "ok": false,
  "pages": 12,
  "errors":   [ { "file": "...", "type": "...", "message": "..." } ],
  "warnings": [ ... ]
}

The command exits with status 1 if there are errors, and 0 otherwise.

run

Takes a Dapper object and returns the report as a hash reference.

classify

Takes a problem and returns a short name for its kind: schema, front_matter, layout, template, duplicate, link, setting, component, accessibility, seo or other.

Takes a Dapper object that has just been built, and returns a problem for each link or image in an HTML page that points to a file the site does not have.

target_path

Takes a link, the directory of the page it is on (e.g. /blog/post/) and the site's URL, and returns the path in the site it points to, or nothing for links that lead outside the site (or to the same page).

exists_in

Takes the output directory and a path in the site, and returns true if a file is there (or, for a directory, an index.html in it).

warnings

Takes a Dapper object that has just been built, and returns warnings about the site's settings and pages.

quality

Takes a Dapper object that has just been built, and returns warnings about accessibility (images without alt text, skipped heading levels, a page with no language, links with no text or only vague text such as "click here") and search engines (missing, duplicate or overlong titles and descriptions). check: { accessibility: false } or check: { seo: false } in _config.yml turns a group off.

text

Takes a report from "run" and returns it as text for people.