Frontmatter
Frontmatter
Lettuce reads YAML frontmatter at the very top of any note. It’s optional — a note without frontmatter is perfectly valid — but a few keys unlock useful behaviour.
---
title: My note
tags: [project, urgent]
date: 2026-05-28
published: true
---
# My note
...
Keys Lettuce recognises
| Key | Type | Effect |
|---|---|---|
title |
string | Display name in sidebar (overrides filename) |
tags |
list of strings | Added to the tag index; can also use inline #tag |
published |
bool | If true, included in the static site build |
description (or summary) |
string | Used for <meta> description / OpenGraph on the published page (falls back to the note’s lead text) |
aliases |
list of strings | Alternative names that [[link]] resolves to |
date |
date or datetime | Shown in the note’s meta row and used for recency ranking |
updated (or modified) |
date or datetime | Shown in the note’s meta row; takes precedence over date for recency |
author |
string | Shown in the note’s meta row |
enhance |
bool or ai |
Opt-in: restructure into a TOC + collapsible sections at publish time (ai adds LLM summaries) |
dropcap |
bool | Opt-in decorative drop-cap on the first paragraph when published |
A couple of keys are read only from the vault’s root index.md: lint: (the tag/alias schema a folder enforces) and immutable: (the write-once path list). (marp: is a per-note slide directive read by the deck renderer, not a folder-index key — see [[CLI cookbook/00 Overview|lettuce slides]].)
Unknown keys are preserved verbatim — Lettuce never strips fields it doesn’t recognise. Use this freely for your own conventions (status: in-progress, mood: focused, etc.).
Why frontmatter, why YAML
It’s the de facto standard across the Markdown ecosystem — works with Jekyll, Hugo, Obsidian, Quartz, etc., so your vault is portable.
YAML is structured, so agents can write to it without ambiguity.
Lettuce’s write tools include a frontmatter-safe edit primitive (
patch_sectionwithtarget_type: "frontmatter").
Common patterns
Status tracking
status: draft # or "in-review", "published", "archived"
owner: bbot
last-reviewed: 2026-05-01
Then in any note, query with:
search(query: "status: draft")
Custom dates
deadline: 2026-06-15
shipped: 2026-05-20
status: draft and deadline: 2026-06-15 are both queryable strings to search. Lettuce doesn’t enforce a schema — that’s deliberate.
Multi-line strings
description: >
This is a multi-line description that flows
onto a second line and gets joined with spaces.
notes: |
This preserves
newlines exactly.
Editing safely
The inspector’s Frontmatter tab gives you a typed editor. Use it for keys with complex types (lists, dates) — much safer than hand-editing the YAML, which is easy to break.
For agents, prefer patch_section with target_type: "frontmatter" over write_note — it preserves the rest of the file’s structure and rewrites only the frontmatter block.
Gotchas
Frontmatter must be the first thing in the file. No blank lines, no BOM, no
# headingbefore it.---start and end markers must be on their own lines. Lettuce won’t recognise frontmatter delimited by---or-- -.Quoting matters for special characters.
tags: [c++, c#]is fine;tags: [c#]alone parses#as a YAML comment. Usetags: ['c#'].
Related
Agent reference/05 Write tools —
patch_sectionfor safe frontmatter mutationsPublishing/01 Publishing a note — what
published: trueactually does