simon-dt/gulp-twig

Error compiling twig template

Opened this issue · 0 comments

I have one basic template where I connect other parts with embed and which contains several block

{# layout.html.twig #}
{# title #}
<title>
  {% block title %}{% endblock title %}
</title>

{% embed 'header.html.twig' with {'bem_parent': 'body'} %}
  {% block header_content %}
    {% embed 'logo.html.twig' with {'bem_parent': 'header'} %}{% endembed %}
  {% endblock header_content %}
{% endembed %}

{# content left #}
{% block content_left %}{% endblock content_left %}
{# header.html.twig #}
{% block header_container %}
  {% spaceless %}
    <header class="{{ bem_parent }}__header header">
      {% block header_content %}
      {% endblock %}
    </header>
  {% endspaceless %}
{% endblock %}
{% block logo_container %}
  {% spaceless %}
    <h1 class="{{ bem_parent }}__logo logo">
      ...
    </h1>
  {% endspaceless %}
{% endblock %}

I also have inheritance index.html.twig

{# index.html.twig #}
{% extends 'layout.html.twig' %}

{% block title %}
  title
{% endblock title %}

{% block content_left %}
  <aside class="page__content page__content_left">
    content left
  </aside>
{% endblock content_left %}

after compiling index .html .twig contains correct embed but in place of the block after embed is empty:

{# from inspector #}
<html lang="ru">
  <head>
    <title>
        title
    </title>
  </head>
  <body class="body">
    <header class="body__header header">
      <h1 class="header__logo logo">
        <a class="logo__link" href="javascript:void(0);">Logo</a>
      </h1>
    </header>
    <main class="body__page page">      
    </main>
  </body>
</html>