Understanding Frontmatter
Every post starts with a frontmatter block between two --- lines. It's a simple list of key: value pairs that the editor manages for you.
The fields
- title (required) - shown in the
<title>tag and as the heading. - slug (required) - the URL segment. Lowercase letters, numbers, and hyphens only.
- date (required) - the publish date,
YYYY-MM-DD. Drives ordering. - updated - last meaningful edit; the admin sets this for you on save.
- category (required) - the single category this post belongs to.
- description (required) - the meta description, around 150 characters.
- image / image_alt - an optional hero image and its alt text.
- draft -
truehides the post from the public, sitemap, and feed. - hero -
truefeatures the post large at the top of the homepage. - featured -
trueadds it to the homepage featured row.
You rarely type this by hand
The post editor turns these into normal form fields - a title box, a category dropdown, a date picker, and toggles - and writes the frontmatter for you. Knowing what's underneath just helps when you edit files directly over SFTP.