Skip to content
docs-sitekit

Menu

Type to search the docs.

↑ ↓ move · Enter open · Esc close

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

sitekit.config.json
{
  "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:

  • error is printed by the build, and sitekit check exits with 1, so a pipeline that runs it stops. The last line of the check says Not safe to publish.
  • warning is printed with the file and the line, and the check still ends with Safe to publish.
  • off is 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:

KindA line it prints
linksdocs/problems.md:8: warning: Link "./nope.md" does not match any file
excludedLinksdocs/problems.md:8: warning: Link "./hidden.md" points to an excluded file, so only its text is kept
anchorsdocs/problems.md:8: warning: Link "./guide.md#nowhere" points to a heading that does not exist in docs/guide.md
imagesdocs/problems.md:10: error: Image "./pic.png" does not exist
frontmatterdocs/problems.md:2: warning: Frontmatter key "titel" is not one the kit reads (title, description, order, tags, meta, links). Did you mean "title"?
orderdocs/problems.md:3: error: Frontmatter "order" must be a number, and this is "first". Write it without quotes, for example order: 2.
duplicateHeadingsdocs/problems.md:21: warning: Heading "Same" makes the same anchor as the one on line 19, so its link is #same-1
calloutsdocs/problems.md:12: warning: "[!NOTES]" is not a callout marker, so this stays a plain blockquote. The markers are [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION]
variablesdocs/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.
snippetsdocs/problems.md:15: error: Snippet "missing.md" was not found. Snippets are the files under snippets/ at the root of the repository.
carddocs/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

sitekit.config.json
{
  "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:

  • excludePaths removes the files that match from the site. A page in docs/drafts/ is not read, so it has no page, no search entry and no line in llms.txt. The globs are relative to sources.root.
  • replace swaps each text everywhere it is found, before the page is read. The page above is built as The client the client runs on host the build host and ticket PROJ-1234 is open.
  • denyPatterns are regular expressions that sitekit check reports as a leak, besides the credentials and internal hosts it always looks for. The ticket number above is reported as deny-pattern-1, once for the source file and once for each built file that holds it. A leak is an error.
  • allow lists exact texts that check accepts although a pattern matches them. Without it, the support address above is reported as an email-address by the built-in patterns. With it, it passes.

Variables

sitekit.config.json
{
  "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

sitekit.config.json
{
  "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 sayssitekit check prints
a public repositoryNothing about the repository.
a private one, and no acknowledgePublicPageserror: 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 truewarning: The repository is private, and GitHub Pages will publish this site publicly. Acknowledged in the config.
target as noneNothing: 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.

Edit this page

Last updated