如何使用布局,部分与如下所示的句柄模板?使用布局,部分与手柄模板
我看过partial文档,但仍无法弄清楚我想实现的目标。
default.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>
的index.html
{{#> default}}
{{ include header }}
<p>This is some other content</p>
{{ include footer }}
了header.html
<h1>This is a header</h1>
footer.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>
检查文档partials.html –
@AndreyEtumyan。我更新了我的问题。 – Ishan