{"id":270768,"date":"2015-12-21T10:53:02","date_gmt":"2015-12-21T07:53:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=270768"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=270768","title":{"rendered":"Handlebars. \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e"},"content":{"rendered":"<p>       \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 <a href=\"http:\/\/handlebarsjs.com\/\">Handlebars <\/a>\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0435\u0433\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438\u2026<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7a4\/ba0\/3f1\/7a4ba03f16584779add4d6da905c0cbc.png\"\/><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Handlebars \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b. \u0428\u0430\u0431\u043b\u043e\u043d\u044b Handlebars \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 <a href=\"https:\/\/mustache.github.io\/\">Mustache <\/a> \u2014 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043e\u043d\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b. \u041f\u043e\u043b\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/wycats\/handlebars.js#differences-between-handlebarsjs-and-mustache\">\u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<h1>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h1>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Handlebars \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b <i>handlebars.js<\/i>:<\/p>\n<pre><code class=\"html\">&lt;script src=&quot;js\/handlebars.js&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d\u044b Handlebars \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTML, \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 handlebars-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u0421\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 handlebars-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440:<\/p>\n<pre><code class=\"html\">{{some_contents}} <\/code><\/pre>\n<p>  \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b Unicode \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445:<\/p>\n<pre><code class=\"diff\">\u041f\u0440\u043e\u0431\u0435\u043b ! &quot; # % & ' ( ) * + , . \/ ; &lt; = &gt; @ [ \\ ] ^ ` { | } ~ <\/code><\/pre>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d Handlebars \u0432 \u0432\u0430\u0448 HTML-\u043a\u043e\u0434, \u0432\u043a\u043b\u044e\u0447\u0438\u0432 \u0435\u0433\u043e \u0432 \u0442\u044d\u0433 &lt;script \/&gt;:<\/p>\n<pre><code class=\"javascript\">&lt;script id=&quot;entry-template&quot; type=&quot;text\/x-handlebars-template&quot;&gt;   &lt;div class=&quot;entry&quot;&gt;     &lt;h1&gt;{{title}}&lt;\/h1&gt;   &lt;\/div&gt; &lt;\/script&gt; <\/code><\/pre>\n<p>  \u0412 JavaScript \u0448\u0430\u0431\u043b\u043e\u043d \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Handlebars.compile:<\/p>\n<pre><code class=\"javascript\">var source   = $(&quot;#entry-template&quot;).html(); var template = Handlebars.compile(source); <\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"http:\/\/handlebarsjs.com\/precompilation.html\">\u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430<\/a>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0435\u043c\u043a\u043e\u0441\u0442\u0438, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438.<\/p>\n<p>  Handlebars \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043d\u0430\u0448 \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"javascript\">var context = { title: &quot;\u0421\u043e\u0431\u0430\u043a\u0435 \u041a\u0430\u0447\u0430\u043b\u043e\u0432\u0430&quot; }; var html    = template(context); <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c HTML-\u043a\u043e\u0434:<\/p>\n<pre><code class=\"html\">&lt;div class=&quot;entry&quot;&gt;   &lt;h1&gt;\u0421\u043e\u0431\u0430\u043a\u0435 \u041a\u0430\u0447\u0430\u043b\u043e\u0432\u0430&lt;\/h1&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  Handlebars-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0443\u0442\u0438, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0430\u043c\u0438. \u041e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">&lt;div class=&quot;entry&quot;&gt;   &lt;h1&gt;{{title}}&lt;\/h1&gt;   &lt;h2&gt;{{author.name}}&lt;\/h2&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e author \u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0437\u0430\u0442\u0435\u043c \u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e name.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">var context = {   title: &quot;\u0421\u043e\u0431\u0430\u043a\u0435 \u041a\u0430\u0447\u0430\u043b\u043e\u0432\u0430&quot;,   author: {     id: 47,     name: &quot;\u0421\u0435\u0440\u0433\u0435\u0439 \u0415\u0441\u0435\u043d\u0438\u043d&quot;   } }; <\/code><\/pre>\n<p>  \u041f\u0443\u0442\u0438 Handlebars \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c <b>..\/<\/b> \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u0421 \u043d\u0438\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u043c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u043e\u0432\u044b\u0435 \u0445\u0435\u043b\u043f\u0435\u0440\u044b.<\/p>\n<p>  Handlebars \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0435 \u0432 \u0434\u0432\u043e\u0439\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 {{ }}. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0442\u0440\u043e\u0439\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 {{{ }}}. \u0427\u0442\u043e\u0431\u044b \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e HTML-\u043a\u043e\u0434 \u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <i>new <b>Handlebars.SafeString<\/b>(result)<\/i><\/p>\n<h2>\u0425\u0435\u043b\u043f\u0435\u0440\u044b<\/h2>\n<p>  Handlebars-\u0445\u0435\u043b\u043f\u0435\u0440 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043d\u043e\u043b\u044c \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (\u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b). \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 handlebars-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0445\u0435\u043b\u043f\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0447\u0438\u0441\u043b\u043e \u0438\u043b\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0425\u0435\u043b\u043f\u0435\u0440 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 HTML \u043a\u043e\u0434.<\/p>\n<pre><code class=\"javascript\">{{{link &quot;\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435...&quot; poem.url}}} <\/code><\/pre>\n<p>  Handlebars-\u0445\u0435\u043b\u043f\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<pre><code class=\"html\">&lt;div&gt;   &lt;h1&gt;{{poem.title}}&lt;\/h1&gt;   {{link &quot;\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435...&quot; poem.url}} &lt;\/div&gt; <\/code><\/pre>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0445\u0435\u043b\u043f\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <b>Handlebars.registerHelper<\/b>. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0445\u0435\u043b\u043f\u0435\u0440\u0430:<\/p>\n<pre><code class=\"javascript\">var context = {   poem: {     title: &quot;\u0421\u043e\u0431\u0430\u043a\u0435 \u041a\u0430\u0447\u0430\u043b\u043e\u0432\u0430&quot;,     url: &quot;Sobake_Kachalova.html&quot;   } }; Handlebars.registerHelper('link', function(text, url) {   url = Handlebars.escapeExpression(url);      \/\/\u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f   text = Handlebars.escapeExpression(text);   return new Handlebars.SafeString(&quot;&lt;a href='&quot; + url + &quot;'&gt;&quot; + text + &quot;&lt;\/a&gt;&quot;); }); <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"html\">&lt;div&gt;   &lt;h1&gt;\u0421\u043e\u0431\u0430\u043a\u0435 \u041a\u0430\u0447\u0430\u043b\u043e\u0432\u0430&lt;\/h1&gt;   &lt;a href='Sobake_Kachalova.html'&gt;\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435...&lt;\/a&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  Handlebars-\u0445\u0435\u043b\u043f\u0435\u0440\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043d\u0435\u043f\u0430\u0440\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041a\u043b\u044e\u0447\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 handlebars-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 (\u0442.\u0435. \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u043f\u0443\u0442\u044f\u043c\u0438, \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438).<\/p>\n<pre><code class=\"javascript\">{{link &quot;\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435...&quot; href=poem.url class=&quot;poem&quot;}} <\/code><\/pre>\n<p>  \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0445\u0435\u043b\u043f\u0435\u0440\u0430:<\/p>\n<pre><code class=\"javascript\">Handlebars.registerHelper('link', function(text, options) {   console.log(options.hash['href']);   \/\/\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043b\u0435\u0436\u0430\u0449\u0435\u0435 \u0432 poem.url   console.log(options.hash['class']); \/\/&quot;poem&quot;   return new Handlebars.SafeString(&quot;&lt;a href=\\&quot;&quot; + options.hash['href'] + &quot;\\&quot;&gt;&quot; + Handlebars.escapeExpression(text) + &quot;&lt;\/a&gt;&quot;); }); <\/code><\/pre>\n<p>  \u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0438\u043c\u0435\u043d \u043c\u0435\u0436\u0434\u0443 \u0445\u0435\u043b\u043f\u0435\u0440\u0430\u043c\u0438 \u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0441\u043a\u0430\u0436\u0435\u043c, \u0443 \u043d\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 handlebars-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 {{name}} \u0438 \u0445\u0435\u043b\u043f\u0435\u0440 {{name}}). Handlebars \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430:<\/p>\n<pre><code class=\"html\">&lt;p&gt;{{.\/name}} or {{this\/name}} or {{this.name}}&lt;\/p&gt; <\/code><\/pre>\n<p>  \u041b\u044e\u0431\u043e\u0435 \u0438\u0437 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 handlebars-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043f\u043e\u043b\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 {{name}} \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u0430 \u043d\u0435 \u0445\u0435\u043b\u043f\u0435\u0440 \u0441 \u0442\u0435\u043c \u0436\u0435 \u0441\u0430\u043c\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c.<\/p>\n<h2>\u0411\u043b\u043e\u043a\u043e\u0432\u044b\u0435 \u0445\u0435\u043b\u043f\u0435\u0440\u044b<\/h2>\n<p>  \u0411\u043b\u043e\u043a\u043e\u0432\u044b\u0435 \u0445\u0435\u043b\u043f\u0435\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0440\u0443\u0433\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a \u0432 \u043d\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435. \u0411\u043b\u043e\u043a\u043e\u0432\u044b\u0439 \u0445\u0435\u043b\u043f\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"html\">{{#helper_name}}some_block{{\/helper_name}} <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0445\u0435\u043b\u043f\u0435\u0440\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 <i>Handlebars.registerHelper<\/i> \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0445\u0435\u043b\u043f\u0435\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u0412\u0441\u043b\u0435\u0434 \u0437\u0430 \u0432\u0441\u0435\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b>options<\/b>. \u041e\u043d \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430:<\/p>\n<p>  1) <b>options.fn<\/b> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d Handlebars. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440 1.<\/i> \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0431\u043b\u043e\u043a\u043e\u0432\u044b\u0439 \u0445\u0435\u043b\u043f\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u043e\u0433\u043e \u0432 \u043d\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"html\">&lt;div class=&quot;body&quot;&gt;   {{#bold}}{{body}}{{\/bold}} &lt;\/div&gt; <\/code><\/pre>\n<p>  \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f:<\/p>\n<pre><code class=\"javascript\">Handlebars.registerHelper('bold', function(options) {   return '&lt;div class=&quot;mybold&quot;&gt;' + options.fn(this) + '&lt;\/div&gt;'; }); <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0431\u043b\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u0445\u0435\u043b\u043f\u0435\u0440\u0430 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 options.fn(context), Handlebars \u043d\u0435 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0431\u043b\u043e\u043a\u043e\u0432\u044b\u043c \u0445\u0435\u043b\u043f\u0435\u0440\u043e\u043c. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0434\u0432\u0430\u0436\u0434\u044b!<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 (this). \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043a\u0430\u0436\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u0433\u043e \u0445\u0435\u043b\u043f\u0435\u0440\u0443 \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440:<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440 2.<\/i><\/p>\n<pre><code class=\"html\">&lt;div class=&quot;entry&quot;&gt; {{author}} {{#with poem}}   &lt;div class=&quot;title&quot;&gt;{{title}}&lt;\/div&gt;   &lt;div class=&quot;author&quot;&gt;{{..\/author}}&lt;\/div&gt;   &lt;div class=&quot;year&quot;&gt;{{year}}&lt;\/div&gt; {{\/with}} &lt;\/div&gt; <\/code><\/pre>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c JSON, \u0438\u043c\u0435\u044e\u0449\u0438\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 poem \u043a\u043b\u044e\u0447\u0438 title \u0438 year:<\/p>\n<pre><code class=\"javascript\">{   author: &quot;\u0421\u0435\u0440\u0433\u0435\u0439 \u0415\u0441\u0435\u043d\u0438\u043d&quot;,   poem: {     title: &quot;\u0421\u043e\u0431\u0430\u043a\u0435 \u041a\u0430\u0447\u0430\u043b\u043e\u0432\u0430&quot;,     year: 1925   } } <\/code><\/pre>\n<p>  \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f:<\/p>\n<pre><code class=\"javascript\">Handlebars.registerHelper('with', function(context, options) {   console.log(context);   \/\/{title: &quot;\u0421\u043e\u0431\u0430\u043a\u0435 \u041a\u0430\u0447\u0430\u043b\u043e\u0432\u0430&quot;, year: 1925}   return options.fn(context); }); <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c HTML-\u043a\u043e\u0434:<\/p>\n<pre><code class=\"html\">&lt;div class=&quot;entry&quot;&gt;   \u0421\u0435\u0440\u0433\u0435\u0439 \u0415\u0441\u0435\u043d\u0438\u043d   &lt;div class=&quot;title&quot;&gt;\u0421\u043e\u0431\u0430\u043a\u0435 \u041a\u0430\u0447\u0430\u043b\u043e\u0432\u0430&lt;\/div&gt;   &lt;div class=&quot;author&quot;&gt;\u0421\u0435\u0440\u0433\u0435\u0439 \u0415\u0441\u0435\u043d\u0438\u043d&lt;\/div&gt;   &lt;div class=&quot;year&quot;&gt;1925&lt;\/div&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 <b>..\/<\/b> \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u0443\u0442\u0438 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 author, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0435\u043c\u0443\u0441\u044f \u0432\u043d\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 poem.<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440 3.<\/i> \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u0443 &lt;ul \/&gt; \u0438 \u0432\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432 \u043d\u0435\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u0435\u043c\u0443 \u0431\u043b\u043e\u043a \u043a\u0430\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442 &lt;li \/&gt;.<\/p>\n<pre><code class=\"html\">{{#list nav}}   &lt;a href=&quot;{{url}}&quot;&gt;{{title}}&lt;\/a&gt; {{\/list}} <\/code><\/pre>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442:<\/p>\n<pre><code class=\"javascript\">{   nav: [     { url: &quot;http:\/\/www.museum-esenin.ru\/biography&quot;, title: &quot;\u0411\u0438\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0421\u0435\u0440\u0433\u0435\u044f \u0415\u0441\u0435\u043d\u0438\u043d\u0430&quot; },     { url: &quot;http:\/\/www.fedordostoevsky.ru\/biography&quot;, title: &quot;\u0411\u0438\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0424. \u041c. \u0414\u043e\u0441\u0442\u043e\u0435\u0432\u0441\u043a\u043e\u0433\u043e&quot; },   ] } <\/code><\/pre>\n<p>  \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0445\u0435\u043b\u043f\u0435\u0440\u0430:<\/p>\n<pre><code class=\"javascript\">Handlebars.registerHelper('list', function(context, options) {   var ret = &quot;&lt;ul&gt;&quot;;    for(var i=0, j=context.length; i&lt;j; i++) {     ret = ret + &quot;&lt;li&gt;&quot; + options.fn(context[i]) + &quot;&lt;\/li&gt;&quot;;   }    return ret + &quot;&lt;\/ul&gt;&quot;; }); <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c HTML-\u043a\u043e\u0434:<\/p>\n<pre><code class=\"html\">&lt;ul&gt;   &lt;li&gt;&lt;a href=&quot;http:\/\/www.museum-esenin.ru\/biography&quot;&gt;\u0411\u0438\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0421\u0435\u0440\u0433\u0435\u044f \u0415\u0441\u0435\u043d\u0438\u043d\u0430&lt;\/a&gt;&lt;\/li&gt;   &lt;li&gt;&lt;a href=&quot;http:\/\/www.fedordostoevsky.ru\/biography&quot;&gt;\u0411\u0438\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0424. \u041c. \u0414\u043e\u0441\u0442\u043e\u0435\u0432\u0441\u043a\u043e\u0433\u043e&lt;\/a&gt;&lt;\/li&gt; &lt;\/ul&gt; <\/code><\/pre>\n<p>  2) <b>options.inverse<\/b> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 Handlebars. \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u2014 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u0438 \u0440\u0435\u0448\u0430\u044e\u0442, \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043b\u0438 \u0431\u043b\u043e\u043a, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<pre><code class=\"html\">{{#if isActive}}   &lt;img src=&quot;minus.gif&quot; alt=&quot;Active&quot;&gt; {{else}}   &lt;img src=&quot;plus.gif&quot; alt=&quot;Inactive&quot;&gt; {{\/if}} <\/code><\/pre>\n<p>  Handlebars \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0431\u043b\u043e\u043a, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 {{else}}, \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>options.inverse<\/i>:<\/p>\n<pre><code class=\"javascript\">Handlebars.registerHelper('if', function(conditional, options) {   if(conditional) {     return options.fn(this);   } else {     return options.inverse(this);   } }); <\/code><\/pre>\n<p>  3) <b>options.hash<\/b> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0445\u0435\u043b\u043f\u0435\u0440\u0443 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043d\u0435\u043f\u0430\u0440\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440.<\/i> \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0445\u0435\u043b\u043f\u0435\u0440\u0443 <i>list<\/i> \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u043d\u0430\u043c\u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 &lt;ul \/&gt;.<\/p>\n<pre><code class=\"html\">{{#list nav id=&quot;nav-bar&quot; class=&quot;top&quot;}}   &lt;a href=&quot;{{url}}&quot;&gt;{{title}}&lt;\/a&gt; {{\/list}} <\/code><\/pre>\n<p>  Handlebars \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0430\u0440\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 <i>options.hash<\/i>, \u0433\u0434\u0435 \u043e\u043d\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043a\u0430\u043a \u043a\u043b\u044e\u0447\u0438-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0445\u0435\u043b\u043f\u0435\u0440\u0430:<\/p>\n<pre><code class=\"javascript\">Handlebars.registerHelper('list', function(context, options) {   var attrs = [];   for (key in options.hash) {     attrs.push(key + '=&quot;' + options.hash[key] + '&quot;');   }   return &quot;&lt;ul &quot; + attrs.join(&quot; &quot;) + &quot;&gt;&quot; + context.map(function(item) {     return &quot;&lt;li&gt;&quot; + options.fn(item) + &quot;&lt;\/li&gt;&quot;;   }).join(&quot;\\n&quot;) + &quot;&lt;\/ul&gt;&quot;; }); <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c HTML-\u043a\u043e\u0434:<\/p>\n<pre><code class=\"html\">&lt;ul class=&quot;top&quot; id=&quot;nav-bar&quot;&gt;   &lt;li&gt;&lt;a href=&quot;http:\/\/www.museum-esenin.ru\/biography&quot;&gt;\u0411\u0438\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0421\u0435\u0440\u0433\u0435\u044f \u0415\u0441\u0435\u043d\u0438\u043d\u0430&lt;\/a&gt;&lt;\/li&gt;   &lt;li&gt;&lt;a href=&quot;http:\/\/www.fedordostoevsky.ru\/biography&quot;&gt;\u0411\u0438\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0424. \u041c. \u0414\u043e\u0441\u0442\u043e\u0435\u0432\u0441\u043a\u043e\u0433\u043e&lt;\/a&gt;&lt;\/li&gt; &lt;\/ul&gt; <\/code><\/pre>\n<p>  \u0425\u0435\u0448-\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u043e\u0449\u043d\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0431\u043b\u043e\u0447\u043d\u043e\u043c\u0443 \u0445\u0435\u043b\u043f\u0435\u0440\u0443 \u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0431\u0435\u0437 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h1>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0445\u0435\u043b\u043f\u0435\u0440\u044b<\/h1>\n<p>  1) <b>if<\/b> \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0445\u0435\u043b\u043f\u0435\u0440 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0431\u043b\u043e\u043a\u0430 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e.<\/p>\n<pre><code class=\"html\">&lt;div class=&quot;entry&quot;&gt;   {{#if author}}     &lt;h1&gt;{{firstName}} {{lastName}}&lt;\/h1&gt;   {{else}}     &lt;h1&gt;\u0410\u0432\u0442\u043e\u0440 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d&lt;\/h1&gt;   {{\/if}} &lt;\/div&gt; <\/code><\/pre>\n<p>  2) <b>unless <\/b> \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0445\u0435\u043b\u043f\u0435\u0440 \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0445\u0435\u043b\u043f\u0435\u0440\u0443 <i>if<\/i>. \u0411\u043b\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d, \u0435\u0441\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043d\u0435\u0442 \u043b\u043e\u0436\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"html\">&lt;div class=&quot;entry&quot;&gt;   {{#unless license}}   &lt;h3 class=&quot;warning&quot;&gt;\u0412\u041d\u0418\u041c\u0410\u041d\u0418\u0415: \u042d\u0442\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438!&lt;\/h3&gt;   {{\/unless}} &lt;\/div&gt; <\/code><\/pre>\n<p>  3) <b>each <\/b> \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0445\u0435\u043b\u043f\u0435\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0441\u043f\u0438\u0441\u043a\u043e\u0432. \u0412\u043d\u0443\u0442\u0440\u0438 \u0431\u043b\u043e\u043a\u0430 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <i>this <\/i>\u0434\u043b\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<pre><code class=\"html\">&lt;ul class=&quot;writers_list&quot;&gt;   {{#each writers}}     &lt;li&gt;{{@index}}: {{this}}&lt;\/li&gt;   {{else}}     &lt;li&gt;\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0441\u0442&lt;\/li&gt;   {{\/each}} &lt;\/ul&gt; <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435:<\/p>\n<pre><code class=\"javascript\">{   writers: [     &quot;\u0410. \u0421. \u041f\u0443\u0448\u043a\u0438\u043d&quot;,     &quot;\u0424. \u041c. \u0414\u043e\u0441\u0442\u043e\u0435\u0432\u0441\u043a\u0438\u0439&quot;,     &quot;\u0421\u0435\u0440\u0433\u0435\u0439 \u0415\u0441\u0435\u043d\u0438\u043d&quot;   ] } <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code class=\"html\">&lt;ul class=&quot;writers_list&quot;&gt;   &lt;li&gt;0: \u0410. \u0421. \u041f\u0443\u0448\u043a\u0438\u043d&lt;\/li&gt;   &lt;li&gt;1: \u0424. \u041c. \u0414\u043e\u0441\u0442\u043e\u0435\u0432\u0441\u043a\u0438\u0439&lt;\/li&gt;   &lt;li&gt;2: \u0421\u0435\u0440\u0433\u0435\u0439 \u0415\u0441\u0435\u043d\u0438\u043d&lt;\/li&gt; &lt;\/ul&gt; <\/code><\/pre>\n<p>  \u0411\u043b\u043e\u043a, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 \u0441\u0435\u043a\u0446\u0438\u0435\u0439 {{else}}, \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0441\u0442.<\/p>\n<p>  4) <b>with <\/b> \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0445\u0435\u043b\u043f\u0435\u0440 \u0434\u043b\u044f \u0441\u0434\u0432\u0438\u0433\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0435\u043a\u0446\u0438\u0438 handlebars-\u0448\u0430\u0431\u043b\u043e\u043d\u0430.<\/p>\n<pre><code class=\"html\">&lt;div class=&quot;entry&quot;&gt;   &lt;h1&gt;{{title}}&lt;\/h1&gt;   {{#with author}}     &lt;h2&gt;{{firstName}} {{lastName}}&lt;\/h2&gt;   {{else}}     &lt;h2&gt;\u0410\u0432\u0442\u043e\u0440 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d&lt;\/h2&gt;   {{\/with}} &lt;\/div&gt; <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435:<\/p>\n<pre><code class=\"javascript\">{   title: &quot;\u0421\u043e\u0431\u0430\u043a\u0435 \u041a\u0430\u0447\u0430\u043b\u043e\u0432\u0430&quot;,   author: {     firstName: &quot;\u0421\u0435\u0440\u0433\u0435\u0439&quot;,     lastName: &quot;\u0415\u0441\u0435\u043d\u0438\u043d&quot;   } } <\/code><\/pre>\n<p>  5) <b>log <\/b> \u2014 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430.<\/p>\n<pre><code class=\"html\">{{log &quot;\u0424\u0430\u043c\u0438\u043b\u0438\u044f: &quot; lastName &quot;; \u0418\u043c\u044f: &quot; firstName}} <\/code><\/pre>\n<p>  \u0414\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 <i>Handlebars.logger.log<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/>  \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0445\u0435\u043b\u043f\u0435\u0440\u0430\u0445 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"http:\/\/handlebarsjs.com\/builtin_helpers.html\">\u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<h1>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 (Partials)<\/h1>\n<p>  Partials \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u0443\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432. Partials \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0435 handlebars-\u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u0434\u0440\u0443\u0433\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Partial, \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <b>Handlebars.registerPartial<\/b>:<\/p>\n<pre><code class=\"javascript\">Handlebars.registerPartial('myPartial', '{{name}}') <\/code><\/pre>\n<p>  Partial \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u2014 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<p>  \u0412\u044b\u0437\u043e\u0432 Partial:<\/p>\n<pre><code class=\"html\">{{&gt; myPartial }} <\/code><\/pre>\n<p>  Partial \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435. \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c Partial \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 Partial:<\/p>\n<pre><code class=\"html\">{{&gt; myPartial myOtherContext }} <\/code><\/pre>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e Partials \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u0439\u0434\u044f <a href=\"http:\/\/handlebarsjs.com\/partials.html\">\u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/273581\/\"> http:\/\/habrahabr.ru\/post\/273581\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 <a href=\"http:\/\/handlebarsjs.com\/\">Handlebars <\/a>\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0435\u0433\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438\u2026<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7a4\/ba0\/3f1\/7a4ba03f16584779add4d6da905c0cbc.png\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-270768","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/270768","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=270768"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/270768\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=270768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=270768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=270768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}