Guides1 min read

Writing a post: the fields that matter

Title, description, date, category and cover: what each field of a post does and what happens when one is missing.

Every post starts with a block of fields between two lines of dashes. Four are required, and a missing one stops the build with an error rather than shipping a broken card.

The required fields

  • title is the heading of the post and the title of its card on the blog index.
  • description is the line under the title on the index and the text search engines show under the link. One sentence that says what a reader gets from the post works better than a teaser.
  • date orders the index: newest first. Use the YYYY-MM-DD form.
  • category is a free-form label. Each one gets its own page at /blog/category/<name>, linked from every post that carries it.

The optional ones

  • cover is a path to an image, shown as a thumbnail on the index and as a banner on the post. A post without one renders fine as text.
  • updated is a date, for when you change a post that was already published. It is shown next to the publication date and tells search engines the page changed. It holds one date: editing a post three times overwrites it each time.
  • draft: true keeps a post out of the index, the category pages, the RSS feed and the sitemap while you write it. It still renders at its own address when you run the site locally, so you can preview it.

What you get without asking

The reading time is worked out from the text. A feed is served at /blog/rss.xml and is declared in the page, so feed readers find it on their own. Each post also gets a generated image for link previews, with or without a cover.

The full reference, including how the example covers take your brand color, is in docs/blog.md.