Skip to content

Instantly share code, notes, and snippets.

View esatterwhite's full-sized avatar
:octocat:

Eric Satterwhite esatterwhite

:octocat:
View GitHub Profile

Template composition with inclusion

Every template language I have seen provides some mechanism for one template to include another, thus supporting the reuse of repeated elements like headers and footers. The included templates are called partials in Mustache parlance:

<!-- home.hbs -->
<html>
<body>
  {{> header}}
  <p> HOME </p>
  {{> footer}}