nunjs

0.0.3 • Public • Published

nunjs

Nunjucks wrapper, adds Jinja2 engine for Sails/Express in a simplest way.

Sails is great! But it's absolutly unconfigurable. There are only two template engines to choose - ejs and jade. I hate them both. Jinja is simplier and better for me. I'm sure you are lazy like me and prefer to use powerful modules ready-to-use, without voodoo practices.

Important!

This module is a patch for sails.js version 0.9.4 and earlier. For newest versions, you can fully use consolidated nunjucks module

Install

Basic

$ npm install nunjs 

From GitHub

$ npm install git://github.com/rootStar-lock/nunjs.git

Usage

It is simple, very simple. Just install and config your app.

Express

Add/change your app.js file like:

app.set('views', __dirname + '/views');
app.set('view engine', 'nunjs');
app.use(express.favicon());

Sails

Change your engine option in config/views.js to nunjs

module.exports.views = {
    engine: 'nunjs',
    layout: true //Ingnored. Use extends command http://jinja.pocoo.org/docs/templates/#template-inheritance
}

Next ?

After that add your .nunjs templates in your views folder.

Additional links

Contacts

My own luna park with nuns and chess :) Enjoy

Readme

Keywords

none

Package Sidebar

Install

npm i nunjs

Weekly Downloads

3

Version

0.0.3

License

BSD-2-Clause

Last publish

Collaborators

  • rootstar