javascript - Using custom delimiters hogan-express and handling {{{ yield }}} -
i'm having problem figuring out. i'm trying use hogan.js (via hogan-express) in new expressjs application want use hogan.js in front-end (where i'll using backbone, lodash, etc).
i using layout have
... {{> header }} {{{ yield }}} {{> footer }} ... and then, bottom of layout have:
<script type="text/template"> {{> template }} </script> so far delimited entries handled hogan-express template gets inserted {{> template }} call contains delimited entries. here's how looks:
<section>{{name}}</section> and need ignored hogan-express hogan in front-end handles it.
now, don't mind changing delimiters hogan-express. tried , works but... using custom delimiters breaks {{{ yield }}} call. tried using <% %> delimiters , changing yield <%{ yield }%> (and various variations of that) nothing seems work.
any idea on how use custom delimiters in hogan-express without breaking 'yields'?
thank you!
to solve problem in expressjs 4.x use
app.locals.delimiters = '<% %>'; just plase snippet in app.js after
app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'hjs');
Comments
Post a Comment