--- layout: docs title: Front-matter prev_section: configuration next_section: posts permalink: /docs/frontmatter/ --- The front-matter is where Jekyll starts to get really cool. Any file that contains a [YAML](http://yaml.org/) front matter block will be processed by Jekyll as a special file. The front matter must be the first thing in the file and must take the form of valid YAML set between triple-dashed lines. Here is a basic example: {% highlight yaml %} --- layout: post title: Blogging Like a Hacker --- {% endhighlight %} Between these triple-dashed lines, you can set predefined variables (see below for a reference) or even create custom ones of your own. These variables will then be available to you to access using Liquid tags both further down in the file and also in any layouts or includes that the page or post in question relies on.
If you use UTF-8 encoding, make sure that no BOM
header
characters exist in your files or very, very bad things will happen to
Jekyll. This is especially relevant if you’re running Jekyll on Windows.
If you want to use Liquid tags and variables but don’t need anything in your front-matter, just leave it empty! The set of triple-dashed lines with nothing in between will still get Jekyll to process your file. (This is useful for things like CSS and RSS feeds!)
Variable | Description |
---|---|
|
If set, this specifies the layout file to use. Use the layout file
name without the file extension. Layout files must be placed in the
|
|
If you need your processed blog post URLs to be something other than
the default |
|
Set to false if you don’t want a specific post to show up when the site is generated. |
|
Instead of placing posts inside of folders, you can specify one or more categories that the post belongs to. When the site is generated the post will act as though it had been set with these categories normally. Categories (plural key) can be specified as a YAML list or a space-separated string. |
|
Similar to categories, one or multiple tags can be added to a post. Also like categories, tags can be specified as a YAML list or a space- separated string. |
Variable | Description |
---|---|
|
A date here overrides the date from the name of the post. This can be used to ensure correct sorting of posts. |