Spelt Docs

Front matter

Spelt uses front matter to determine how it should render your files. Any file that contains front matter will be processed by the rendering engine. The front matter must start on the first line of a file, is defined by a set of triple-dashed lines, like in this example:

---
layout: post
title:  Blogging Like a Hacker for Non-Hackers
date: 2015-09-10 09:41:00 +0100
---

In between those dashed lines you can specify metadata for your file. A blog post requires title and date to be define at the least.

The format used to specify this metadata is called YAML. YAML is a human friendly way to represent some data. Any metadata that you specify here will be available to your template files.

Predefined variables

There are a number of predefined variables that you can set in the front matter of your files.

Variable Description
title The title of your blog post or page.
date The date of the post. Dates must be specified in the format YYYY-MM-DD HH:MM:SS +/-TTTT. Hours, minutes, seconds, and timezone offset are optional.
layout If defined, this specifies which layout to use. Layout files must be placed in the _layouts directory.
permalink Set this variable to define the URL for this post or page in the generated site. By default, blog post permalinks are generated using this format: /year/month/day/title.html
category
categories
You can specify one or more categories a blog post belongs to. Categories (plural) can be specified as a YAML list or a comma-separated string.