假设我有一个主要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});
});
而不是为网站的两个部分分别使用两种不同的布局?