Options: content checks and publishing
The keys that decide what blocks a publish and what is kept out of the site: check, anonymize, vars and deploy.
Each key is documented in the configuration reference, under check, anonymize, vars and deploy. This page shows them together and says what they change. What the check reads and what it skips is in Content.
How serious each finding is
{
"check": {
"links": "error",
"excludedLinks": "warning",
"anchors": "warning",
"images": "error",
"frontmatter": "warning",
"order": "error",
"duplicateHeadings": "off",
"callouts": "warning",
"variables": "error",
"snippets": "error",
"card": "error"
}
}Each key is a kind of finding, and the value is error, warning or off. The example writes every kind, but you only need to write the ones you want to change: a kind you leave out keeps its default. The highlighted lines are the three that differ from the defaults, a broken link and an undeclared variable that now stop a publish, and repeated headings that are no longer reported.
What the value does:
erroris printed by the build, andsitekit checkexits with 1, so a pipeline that runs it stops. The last line of the check saysNot safe to publish.warningis printed with the file and the line, and the check still ends withSafe to publish.offis not reported at all.
The build only prints findings, whatever their severity. The command sitekit check is the one that decides. A name under check that is not a kind fails with the name and the list of kinds.
These are lines that sitekit check prints for a page with one of each problem, with the default severity of each kind:
| Kind | A line it prints |
|---|---|
links | docs/problems.md:8: warning: Link "./nope.md" does not match any file |
excludedLinks | docs/problems.md:8: warning: Link "./hidden.md" points to an excluded file, so only its text is kept |
anchors | docs/problems.md:8: warning: Link "./guide.md#nowhere" points to a heading that does not exist in docs/guide.md |
images | docs/problems.md:10: error: Image "./pic.png" does not exist |
frontmatter | docs/problems.md:2: warning: Frontmatter key "titel" is not one the kit reads (title, description, order, tags, meta, links). Did you mean "title"? |
order | docs/problems.md:3: error: Frontmatter "order" must be a number, and this is "first". Write it without quotes, for example order: 2. |
duplicateHeadings | docs/problems.md:21: warning: Heading "Same" makes the same anchor as the one on line 19, so its link is #same-1 |
callouts | docs/problems.md:12: warning: "[!NOTES]" is not a callout marker, so this stays a plain blockquote. The markers are [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION] |
variables | docs/problems.md:17: warning: Unknown variable "undeclared". Define it under "vars" in sitekit.config.json, or put it in a code span to show it as written. |
snippets | docs/problems.md:15: error: Snippet "missing.md" was not found. Snippets are the files under snippets/ at the root of the repository. |
card | docs/card.md:3: error: Item 1 of "meta" has the key "lable", which the card does not read. It takes "label" and "value". |
Keep files and words out of the site
{
"anonymize": {
"excludePaths": ["docs/drafts/**"],
"replace": {
"BigCorp": "the client",
"builder.internal": "the build host"
},
"denyPatterns": ["PROJ-\\d+"],
"allow": ["support@acme.example"]
}
}Given a page that says The client BigCorp runs on host builder.internal and ticket PROJ-1234 is open. Contact support@acme.example., the example does this:
excludePathsremoves the files that match from the site. A page indocs/drafts/is not read, so it has no page, no search entry and no line inllms.txt. The globs are relative tosources.root.replaceswaps each text everywhere it is found, before the page is read. The page above is built asThe client the client runs on host the build host and ticket PROJ-1234 is open.denyPatternsare regular expressions thatsitekit checkreports as a leak, besides the credentials and internal hosts it always looks for. The ticket number above is reported asdeny-pattern-1, once for the source file and once for each built file that holds it. A leak is an error.allowlists exact texts thatcheckaccepts although a pattern matches them. Without it, the support address above is reported as anemail-addressby the built-in patterns. With it, it passes.
Variables
{
"vars": {
"product": "Acme",
"package": "@acme/queue"
}
}A page that writes {{ product }} is built with Acme in that place, in prose, headings, link text and the frontmatter. In a code span or a fenced block the text is left as written, so a page can show the syntax. A name that is not declared stays as written and is a variables finding.
{{ version }} needs no entry: its value is site.version, else the version of the package.json at the root of the repository. A version written under vars wins for the text of the pages, and it does not change the v2.4.0 label of the footer, which keeps following site.version.
Where it is published
{
"deploy": {
"target": "github-pages",
"acknowledgePublicPages": true,
"repositoryVisibility": "private"
}
}These keys change what sitekit check says about the repository, and nothing in the pages.
| The config says | sitekit check prints |
|---|---|
| a public repository | Nothing about the repository. |
a private one, and no acknowledgePublicPages | error: The repository is private, and GitHub Pages would publish this site publicly. Set deploy.acknowledgePublicPages to true if that is intended. |
a private one, with acknowledgePublicPages as true | warning: The repository is private, and GitHub Pages will publish this site publicly. Acknowledged in the config. |
target as none | Nothing: the visibility is not looked at. |
repositoryVisibility is for a runner where check cannot get the answer from GitHub. Without it, and without an answer, the check stops with error: Cannot tell whether the repository is private. Set deploy.repositoryVisibility in sitekit.config.json.
Last updated