Check type ID#
kind: object_field_type
Purpose#
Require that a frontmatter field has a specific type.
Configuration keys#
| Field | Required | Default | Meaning |
|---|---|---|---|
field | yes | - | Frontmatter key to check. |
type | yes | - | One of string, boolean, array, object, number, integer. |
Example#
collections:
notes:
path: notes
checks:
- kind: object_field_type
field: year
type: integerWorked example#
Here year is a string, not an integer. An inline object_field_type check fails the item, points at the offending field with a JSON pointer (/year) and a path:line prefix, and exits 1.
Input#
notes/dune.md
---
title: Dune
year: "not a number"
---
# Dune.katalyst/bases/my_directory.yaml
type: filesystem
root: .
collections:
notes:
path: notes
checks:
- kind: object_field_type
field: year
type: integerCommand#
$ katalyst check notes/dune
<project>/notes/dune.md:3: /year: field "year" must be type "integer"
exit status 1