【发布时间】:2017-05-17 01:48:33
【问题描述】:
我想在 hapi.js 中使用 ejs 在包含布局中呈现的模板中定义信息。例如:
layout.html
<html>
<head>
<title><%- contentFor('title') %></title>
</head>
<body>
<%- content %>
</body>
</html>
index.html
contentFor('title', 'My title')
<h1>My content</h1>
对我来说重要的是,无论它如何工作,不同的布局内容都是在模板中定义的,而不是在路由级别传递的。这可能吗?
【问题讨论】:
标签: node.js ejs hapijs hapijs-vision