如何使用布局、带有把手模板的部分,如下所示?
我查看了部分文档,但仍然无法弄清楚我想要实现的目标。
默认.html
站点的不同视图重用默认布局。{{{content}}}
用作将呈现主要内容的占位符。
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
</head>
<body>
<p>This is the top of the body content in the default.html file</p>
{{{content}}}
<p>This is the bottom of the body content in the default.html file</p>
</body>
</html>
索引.html
{{#> default}}
{{ include header }}
<p>This is some other content</p>
{{ include footer }}
header.html
<h1>This is a header</h1>
页脚.html
<p>This is a footer</p>
输出
<!DOCTYPE html>
<html>
<head>
<title>Using Layout, Partials with Handlebars Template</title>
</head>
<body>
<p>This is the top of the body content in the default.html file</p>
<h1>This is a header</h1>
<p>This is some other content</p>
<p>This is a footer</p>
<p>This is the bottom of the body content in the default.html file</p>
</body>
</html>