New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tiny-compilator

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-compilator

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

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
1
Created
Source

tiny-compilator

release travis

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

How to install

npm install tiny-compilator handlebars

How it works

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

const Compilator = require("tiny-compilator");

const compile = new Compilator({
  helpers: "path/to/helper/folder/**/*.js",
  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>
<html>
  <head>
    <meta charset="utf-8" />
    <title></title>
  </head>
  <body>
    {{> body }}
  </body>
</html>

Keywords

compile

FAQs

Package last updated on 26 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts