Architecture
Layouts
Layouts are files where templates are being rendered after it has been compiled by the theme engine.
They are html files located inside the layouts folder and they supports Handlebars.js syntaxes and additional helpers that are provided by the Taojaa theme engine.
Location
.
└── theme
├── layout
| ├── main.handlebars
| ...
├── templates
...
Structure
Layout files should always follow a standard html page structure since it's the container for all templates and can be used to include global contents/assets aross the entire theme. For example the main stylesheets and scripts, header and footer.
<!DOCTYPE html>
<html>
<head>
...
<link rel="stylesheet" href="{{asset_url}}/global.css" />
...
</head>
<body>
{{{ sections "header-group" }}}
...
{{{ content }}}
...
{{{ sections "footer-group" }}}
<script type="text/javascript" src="{{asset_url}}/global.js" />
</body>
</html>
Usage
You can create as many layout files as much as you need inside your theme's layout folder and the way to reference a particular layout in your template is by specifying the name of the layout file inside your template.
{
"layout": "main", // this template will be using the "main.handlebars" layout file
"sections": {
...
},
"order": [],
"data": {
...
}
}