【发布时间】:2018-04-08 00:43:18
【问题描述】:
假设我有一个主要的layout.handlebars 和一个包含两个主要部分的网站。
如果我像这样自定义layout.handlebars,会有什么性能差异:
<head>
<title>{{title}}</title>
<link href="css/bootstrap.css" rel="stylesheet">
{{#if section1}}
<link href="css/section1.css" rel="stylesheet">
{{else}}
<link href="css/section2.css" rel="stylesheet">
{{/if}}
</head>
并像这样渲染:
router.get('/section1', function(req, res){
res.render('section1',{title: 'Section 1', section1: true});
});
而不是为网站的两个部分分别使用两种不同的布局?
【问题讨论】:
标签: html node.js express express-handlebars