Skip to content

How to write frontmatter well

Use YAML with three hyphens, keep keys lowercase, use ISO 8601 dates, and validate the schema before generation.

Frontmatter that stays sane

  1. Three hyphens, on their own lines

    The delimiter is --- at the beginning of a line. Not --- inline. Not ---yaml.

  2. Lowercase keys

    title, date, tags. Not Title or TITLE. Consistency beats cleverness.

  3. ISO 8601 dates

    2024-03-15T10:00:00-05:00. Ambiguous dates break on server timezone changes.

  4. Validate the schema

    A frontmatter with the wrong type (string where array expected) fails at build time, hours after commit. Validate on save.