如何在Express-Handlebars中使用handlebars-layouts

时间:2018-11-09 00:58:13

标签: express handlebars.js express-handlebars

这是我当前的Express设置。如何将车把布局与此设置(https://www.npmjs.com/package/handlebars-layouts)集成。我仍然想使用express-handlebars defaultLayout东西。

var exphbs = require('express-handlebars');

    app.engine(".hbs", exphbs({
      defaultLayout: "layout",
      extname: ".hbs",
      partialsDir: "views/partials/", // same as default, I just like to be explicit
      layoutsDir: "views/layouts/" // same as default, I just like to be explicit
    }));

    app.set('view engine', '.hbs');

0 个答案:

没有答案