8lueberry / express-dot-engine

Node.js engine using the ultra fast doT templating with support for layouts, partials and friendly for front-end web libraries (Angular, Ember, Backbone...)
MIT License
43 stars 10 forks source link

chane settings to use {{}} issue #12

Closed vitaliiznak closed 9 years ago

vitaliiznak commented 9 years ago

When I changed to use {{ }} instead of [[ ]] the partial dont work anymore // doT settings

engine.settings.dot = { evaluate: /[[([\s\S]+?)]]/g, interpolate: /[[=([\s\S]+?)]]/g, encode: /[[!([\s\S]+?)]]/g, use: /[[#([\s\S]+?)]]/g, define: /[[##\s([\w.$]+)\s(:|=)([\s\S]+?)#]]/g, conditional: /[[\?(\?)?\s([\s\S]?)\s]]/g, iterate: /[[~\s(?:]]|([\s\S]+?)\s:\s([\w$]+)\s(?::\s([\w$]+))?\s*]])/g, varname: 'layout, model', strip: false, append: true, selfcontained: false, };

then {{= partial('path/test')}} - partials is not defined

8lueberry commented 9 years ago

In version 1.0.6, varname should include partial too.

...
varname: 'layout, partial, locals, model',

Let me know if that works.

vitaliiznak commented 9 years ago

it works, thanks, sorry for delay

vitaliiznak commented 9 years ago

yeap, it works but only on the same order i mean varname: 'layout, partial, locals, model', - works varname: 'layout, locals, model, partial', - does not work

8lueberry commented 9 years ago

Yes, order is important :)

I'll update the doc soon. Thanks!