Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Layouts

Matt Hinchliffe edited this page · 4 revisions

Layouts are re-usable templates to receive compiled pages and will usually be formed of a document outline and partials. Layouts will inherit the current page data set and the compiled page.

The templating documentation contains more information about template syntax.

Note that the compiled page data must be output with unescaped HTML using a triple mustache: {{{content}}}.

Examples

~/robot-project/pages/home.html:

---
layout: default
title: Home
---
<h1>
    {{page.title}}
</h1>
<p>
    Welcome to {{data.site.name}}!
</p>

~/robot-project/layouts/default.html

<!doctype html>
<html>
<head>
    <title>{{page.title}} | {{data.site.name}}</title>
</head>
<body>
    <div class="wrap">
        {{> header}}
        <div class="content">
            {{{content}}}
        </div>
        {{> footer}}
    </div>
</body>
</html>

Using Robot: Previous: Partials, Next: Pages

Something went wrong with that request. Please try again.