The term “front matter” refers to the stuff at the very top of a file that Jekyll uses to process the file. It’s the stuff between the two lines that look like this:
Everything else in the file is processed as the body. The front matter must be written in YAML or JSON.
One of the things that Jekyll does is allow you to use Liquid templating tags in your content files. This means that you can dynamically generate content by looping through collections of data, e.g. blog posts, or by using information that is stored in site variables.
In order to access this data, you need to put it in the front matter of the file. This is because the Liquid templating tags can only access data that is in the front matter.
Here is an example of a file with front matter:
layout: post
title: "Welcome to Jekyll!"
date: 2015-11-17 16:16:01 +1100
categories: jekyll update
This is the body of the post.
In this example, the front matter consists of three key/value pairs (layout, title and date). These are processed by Jekyll, and the resulting HTML is output to the _layouts directory.
The front matter can also contain YAML or JSON lists. For example:
layout: post
title: "Welcome to Jekyll!"
date: 2015-11-17 16:16:01 +1100
categories:
- jekyll
- update
This is the body of the post.
In this example, the categories key has a value that is a list of two items (jekyll and update).