Frontmatter is a way to add metadata to your pages and access it from templates and the sitemap. Consider the following page:

title: Apollo 40th anniversery
layout: video

Check out this apollo launch video! Crazy how we went from nothing to the moon in under a decade.

With a respective video.html.haml layout:


The power of Frontmatter is its abililty to query data programatically from other templates. For example, if we have several video pages on our site, we can query them via the Site:

title: Youtube videos
%ul{ |r|["video_url"] =~ /youtube/ }.each do |page|
    %a{href: page.request_path}["title"]