Novel Preposterous Mockery
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    nunjspublic

    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

    Keywords

    none

    install

    npm i nunjs

    Downloadsweekly downloads

    4

    version

    0.0.3

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar