Check type ID#
kind: object_required_field
Purpose#
Require that a frontmatter field exists.
Configuration keys#
| Field | Required | Default | Meaning |
|---|---|---|---|
field | yes | - | Frontmatter key that must be present. |
Example#
collections:
notes:
path: notes
checks:
- kind: object_required_field
field: yearWorked example#
The books collection binds the book schema (title plus an integer year). dune.md satisfies the schema and reports OK; foundation.md omits year, so check reports the missing required property and exits 1.
Input#
notes/books/dune.md
---
title: Dune
year: 1965
---
# Dunenotes/books/foundation.md
---
title: Foundation
---
# Foundation.katalyst/storage/my_directory.yaml
type: filesystem
root: .
collections:
books:
path: notes/books
schema: book.katalyst/schemas/book.yaml
$schema: https://json-schema.org/draft/2020-12/schema
title: book
type: object
required: [title, year]
properties:
title: { type: string, minLength: 1 }
year: { type: integer, minimum: 0 }Command#
$ katalyst check books
<project>/notes/books/dune.md: OK
<project>/notes/books/foundation.md: /: missing property 'year'
exit status 1