Frontmatter allows page-specific variables to be included at the top of a template using the YAML or JSON format.

YAML Frontmatter

Let's take a simple ERb template, adding some frontmatter variables to change the layout for this specific page.

layout: "custom"
title: "My Title"
  - one
  - two
  - three

  <% do |f| %>
  <li><%= f %></li>
  <% end %>

Frontmatter must come at the very top of the template and be separated from the rest of the content by a leading and trailing triple hyphen ---. Inside this block, you can create new data which will be available in the template using the hash, e.g. title: "My Title" becomes The layout setting will pass directly to Middleman and change which layout is being used for rendering. You can also set ignore, directory_index, and some other page properties in this way.

JSON Frontmatter

You can also use JSON for your frontmatter. It's delimited by ;;; and looks like this:

"layout": "custom",
"my_list": [

After that, it can be used exactly the same as YAML frontmatter in your page.