jsebfranck
jsebfranck

Reputation: 724

Set swig options with consolidate

I'm currently using swig with consolidate and it works fine :

app.engine('server.view.html', consolidate['swig']);

Now, I would like to tune swig options, and for example change the default value of autoescaping.

Any idea of how I can do that ?

Upvotes: 2

Views: 360

Answers (1)

jsebfranck
jsebfranck

Reputation: 724

I found ! If I interact directly with the swig object, it works. I added :

var swig = require('swig')

Then :

app.engine('server.view.html', consolidate[config.templateEngine]);
swig.setDefaults({
  autoescape: false
});

Upvotes: 1

Related Questions