koa-modules / swig

Koa view render based on Swig, support tags, filters, and extensions
MIT License
30 stars 12 forks source link

some question about koa-swig in using koa-views #23

Open Froguard opened 8 years ago

Froguard commented 8 years ago

how to set filters of koa-swig when I use it in koa-views like this:

var views = require('koa-views');
app.use(views(__dirname + 'views', {
    map:{
        html: 'swig' 
    },
    filters:{
            getAppEnv:function(){
                return env.toLowerCase();
            }
    }
}));

or like this:

var views = require('koa-views');
app.use(views(__dirname + 'views', {
    map:{
        html: 'swig' 
    },
    options:{
        filters:{
            getAppEnv:function(){
                return env.toLowerCase();
            }
        }
    }
}));

two mode both are useless...Is there any problem? how could I set filters via koa-views... thank u!