Partials

Matt Hinchliffe edited this page Aug 2, 2013 · 2 revisions

Partials (or if you prefer, 'includes') are re-usable, nestable templates. They can be included into your pages or layouts or nested recursively. For example a global site header may be shared across all layouts or an object may be used within several pages. See the templating documentation for more information about using partials within templates.

Examples

~/robot-project/partials/header.html:

<header role="banner">
	<div id="site-header">
		<a href="/"><img src="images/logo.png" alt="My logo" rel="logo" /></a>
	</div>
</header>

~/robot-project/layouts/default.html

<!doctype html>
<html>
<head>…</head>
<body>
	<div class="wrap">
		{{> header}}
		<div class="content">
			{{{content}}}
		</div>
		{{> footer}}
	</div>
</body>
</html>

Using Robot: Previous: Data, Next: Layouts