ericf / express-handlebars

A Handlebars view engine for Express which doesn't suck.
BSD 3-Clause "New" or "Revised" License
2.31k stars 384 forks source link

Declaring layouts in templates as declarative. #207

Closed ahmetatar closed 3 years ago

ahmetatar commented 7 years ago

I have two options when I want to specify a layout when rendering a template with express;

req.app.locals.layout = "foo";

or

res.render("mytmp", { layout: "foo", data: bar });

Just as there are a few other alternatives (express-hbs), it must be a way to make it declarative.Is there a similar way of doing this without doing it in the code?

{{!< foo-layout}}

<div id="content">...</div>

I want to do this if nobody is working on it yet.