Build Status


A few root objects are available within any of the supported template types.


The content object is primarily used from within layouts, as it holds the content from the previously rendered page or content.


The site object is the top-level object available within the template.
Various extensions may add additional properties to this object. By default, it has the following:


Default this is set to http://localhost:4242. Through the _config/site.yml file, you may override this value to the URL of your product site, for instance. Normally this is not required, except when creating fully-qualified URLs, which is rare.


From the site object, you have access to the array of registered pages. All struct-based meta-data for each page is directly accessible (and alterable) from it. See the section on page below for more details.

site.pages.each do |page|
  puts "page.title=#{page.title}"
  puts "page.layout=#{page.layout}"

When templates are interpreted, changes to this array are undefined. Before the rendering phase, extensions may add/remove pages within this array, or alter details on the individual pages themselves.


The page object is set to the struct for each page in turn, during processing. It provides access to any properties set in the front-matter, along with other properties used by the engine or extensions.


The url property of each page provides a relative URL from the root of the site for accessing the page. The URL may or may not directly match the output file.

For instance, any path that ends with /index.html will not include the index.html portion in the resulting URL.

This allows for the top-level page of the site (/index.html) to have a URL of simply /. The same rule applies for any directory's index.html.


Normally set through a page's front-matter, the layout property is used by the engine to recursively surround page content with a layout. Any layout may also specify a layout for itself to use, until some end is reached.

The layout property should reference the simple name of the layout.

A page index.html.haml wanting to use the layout from _layouts/default.html.haml should simply specify front-matter such as

layout: default

The correct layout extension (.html) will be selected based upon the page's own extension.

Additional helpers

Additional helpers may be configured into the pipeline.