RandomEtc / ejs-locals

Express 3.x layout, partial and block template functions for the EJS template engine.
298 stars 63 forks source link

Render without expressjs #32

Closed olivercox closed 11 years ago

olivercox commented 11 years ago

I'm trying to work out how I can render a view without express. I can get this to work with ejs directly using the ejs.render() method but can't see how I can do this using ejs-locals.

Any pointers would be greatly appreciated.

Many Thanks

Oliver

RandomEtc commented 11 years ago

I assume it's crashing because the ejs-locals code is looking for options.settings. You might be able to pass an empty object { settings: {} } to overcome that?

Otherwise, please post the errors you're seeing and we can take a closer look.

olivercox commented 11 years ago

More fundamental an issue than that but only because I'm I bit dim sometimes. Once I stopped trying to call ejs.renderFile and just called ejs() I did indeed need to set { settings: {} }.

Thanks for help. Now I can generate emails from templates with all the power of ejs-locals...sweet!

ixisio commented 10 years ago

I've created something similar https://github.com/ixisio/grunt-ejs-locals