1.0.1 • Published 8 years ago

koa-nunjucks1 v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

koa-nunjucks1

Nunjunks rendering middleware for koa 1.x

Usage

var koa = require('koa');
var knj = require('koa-nunjucks1');

var app = koa();
app.use(knj({
    path: __dirname + '/templates',
    extname: '.html'
    //other nunjunks options can be assigned here for nunjunks.Environment obj
}));

or

knj({
    path: __dirname + '/templates',
    extname: '.html'
}, app );
app.use(function *(next){

    this.state.title = 'hello kitty';

    yield next;
});

app.use(function *(next) {
    yield this.render('index', {
        city: 'ChengDu'
    });
});

License

MIT

1.0.1

8 years ago

1.0.0

8 years ago

0.1.0

8 years ago