jorishermans / enchanter

A static site generator with some similarity to the express library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enchanter

Enchanter is a minimalistic site generator, build up your site on an easy way. Following a part of the api of express.js.

var enchanter = require('enchanter');
var app = enchanter();

app.page('/', function(request, response) {
    // do some mongodb queries :)
    response.render('template', {title: "home", message: "body"});
});

app.generateAll();

You can also generate a specific path with the following code:

app.generate('/');

app.generate('/about');

Installation

$ npm install enchanter

Use express

Generate a site with express as parameter.

var enchanter = require('enchanter');
var express = require(express);

var app = enchanter(express);

When you start your application with

node index -d

It will start the application with express. This should be easy while your are developing your application or you want a dynamic and a static generation part.

Events

after - happens at the end of a generate phase.

app.on('after', (page) => {
    console.log('end generating ...');
});

Issues

Please fill an issue when a part of the express api is not covered for you use case!

About

A static site generator with some similarity to the express library

License:MIT License


Languages

Language:JavaScript 90.3%Language:HTML 9.3%Language:CSS 0.5%