publicclass/express-partials

Module breaks when changing default extension

Closed this issue · 1 comments

With ejs, you can change the default extension for ejs templates like this:

app.set('view engine', 'html');
app.engine('html', ejs.renderFile);

Pages without partials work. However, this breaks in express-partials, with the following error.

Cannot find module 'html'
    at Function.Module._resolveFilename (module.js:338:15)

Ah, never mind, fixed with:

app.set('view engine', 'html');
app.engine('html', ejs.renderFile);
partials.register('.html',ejs.render);