I put my ejs
template file in views
folder like:
views | |--foo.html | |--layout.html
so I config my ejs template:
app.set('views', __dirname + '/views'); app.engine('html', require('ejs').renderFile);
I render my foo
template by this:
res.render('foo.html', {title: 'test'});
I want use layout.html
as the master layout template, I also add <%- body%>
tag in layout.html
, but is doesn't work, what I saw is only return the ended foo.html
.
Why the layout.html
can't be the master layout?Or how can I set it to the master layout?