Как использовать макеты, частичные с шаблоном руля, как показано ниже?Использование макета, Partials with Handlebars Template
Я просмотрел документы 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>
Проверьте документацию http://handlebarsjs.com/ partials.html –
@AndreyEtumyan. Я обновил свой вопрос. – Ishan