Skip to content
Build your stack with Handlebars.js for create static pages.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


release travis

Build your stack with Handlebars.js for create static pages.

How to install

npm install tiny-compilator

How it works

Create a Compilator instance with in arguments the paths of layouts, helpers & partials folders. Then call render method of your instance with the path of your page and data to pass:

var Compilator = require('tiny-compilator');

var compile = new Compilator({
  helpers: 'path/to/helper/folder',
  layouts: 'path/to/layout/folder',
  partials: 'path/to/partials/folder'

compile.render('path/to/your/page', data); //=> return html compiled

Page configuration

In top of your page you must declare in attribute the layout chosen as this example:

layout: 'default'
<!-- html page -->

Layout declaration

In your layout html you must call the partial handlebars 'body' where all the page content must be placed:

<!DOCTYPE html>
    <meta charset="utf-8">
    {{> body }}
You can’t perform that action at this time.