check --json
The fields of the contentbit.site-check.v1 report that contentbit check --json prints, with an example.
contentbit check --json--json prints one contentbit.site-check.v1
report and nothing else, with every path relative to the project root. For the
blog of Check a site, without its pages array and without the page finding
on /blog/:
{
"schemaVersion": "contentbit.site-check.v1",
"input": { "kind": "folder", "path": "dist" },
"origin": { "url": "https://bakery.example", "source": "canonicals" },
"summary": { "pages": 5, "errors": 2, "warnings": 2, "ignored": 0 },
"findings": [
{
"code": "CB_LINK_PAGE_MISSING",
"severity": "error",
"message": "nav a gives this finding on 5 pages, so the layout or a shared component renders it. On /: The link /about/ points to no built page, redirect or host route.",
"hint": "Fix the link or add a redirect. If the host app serves the path, add it to links.hostRoutes.",
"element": "nav a",
"origin": {
"kind": "template",
"element": "nav a",
"pages": ["/", "/blog/", "/blog/baking/", "/blog/proofing/", "/blog/shaping/"]
},
"occurrences": [
{ "page": "/", "target": "/about/" },
{ "page": "/blog/", "target": "/about/" },
{ "page": "/blog/baking/", "target": "/about/" },
{ "page": "/blog/proofing/", "target": "/about/" },
{ "page": "/blog/shaping/", "target": "/about/" }
]
},
{
"code": "CB_LINK_ANCHOR_MISSING",
"severity": "error",
"message": "The link /blog/shaping/#pre-shape points to an id that /blog/shaping/ does not have.",
"hint": "Point the link at an id the page has, or give the element it means that id.",
"target": "/blog/shaping/#pre-shape",
"element": "main a",
"origin": {
"kind": "source",
"file": "content/blog/proofing.md",
"line": 15,
"column": 58,
"page": "/blog/proofing/"
}
}
],
"content": {
"files": 3,
"attached": 3,
"findings": [
{
"source": "integrity",
"severity": "warning",
"code": "CB_HEADING_LEVEL_SKIPPED",
"file": "content/blog/baking.md",
"line": 20,
"column": 1,
"message": "heading \"Cool the loaf\" jumps from h2 to h4",
"hint": "Insert an h3 heading or lower this heading level."
}
]
}
}Fields
| Field | Holds |
|---|---|
input | The build folder that was read. Without a build, its kind is none and it lists the folders check searched. |
origin | The site origin, and where it came from. |
summary | The counts of pages, errors, warnings, and ignored findings. |
findings | The built-page findings. |
content | The Markdown that was read: files, attached (the files with a built page), and findings. Absent when no Markdown was read. |
configFindings | The findings about the check settings, and about the installed agent skills on a site without Markdown. Absent when there are none. |
pages | Every built page with its path, its file in the build, and its source document when routes give it one. Empty without a build. |
staleSources | The Markdown files that changed after the build. |
Where a finding points
The origin of a built-page finding has one of three kinds:
kind | Holds |
|---|---|
source | The Markdown file, with its line and column, and the page it builds. |
template | The layout element, and every page it affects. The finding also has an occurrences entry for each page. |
page | The page path. |
The rendered page facts of a page are in
contentbit context <page> --json.