Check type ID#

kind: markdown_title_matches_h1

Purpose#

Require a frontmatter field to match the first H1 heading in the body.

Configuration keys#

FieldRequiredDefaultMeaning
fieldnotitleFrontmatter key compared to the first H1.

Example#

collections:
  notes:
    path: notes
    checks:
      - kind: markdown_title_matches_h1
        field: title

Worked example#

The markdown_title_matches_h1 check ties a frontmatter field to the document’s first H1. When they disagree, check reports the mismatch and exits 1.

Input#

notes/dune.md

---
title: Dune
---
# Children of Dune

.katalyst/bases/my_directory.yaml

type: filesystem
root: .
collections:
  notes:
    path: notes
    checks:
      - kind: markdown_title_matches_h1
        field: title

Command#

$ katalyst check notes/dune
<project>/notes/dune.md:4: /title: "Dune" does not match first H1 "Children of Dune"
exit status 1