Include views and assets
@{view(name, model)} renders another view in place, so repeated pieces (a card, a row, a footer) live in one file. The second argument is the model of the included view.
@{import('a.js', 'a.css')} writes the <script> and <link> tags for files in public/js/ and public/css/. List several files joined with + to get one tag per file.
<article class="card"><h2>@{model.title}</h2></article>@{layout('')}
@{import('app.js', 'app.css')}
@{foreach item in model.items}
@{view('card', item)}
@{end}exports.install = function() {
ROUTE('GET /', page);
};
function page($) {
$.view('index', { items: [{ title: 'First' }, { title: 'Second' }] });
}