Is using nested extends a wise idea or will it be a performance/maintenance nightmare? Here's a basic example of using nested extends in Twig. I figured this is a probably common use-case. You have a very general _layout.html that contains your common CSS, JS, meta tags, etc.

{# _layout.html #}
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;{{title}}&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
  {% block content %}{% endblock %}
&lt;/body&gt;
&lt;/html&gt;


Then you have a _subpage.html template that shapes the way all your subpages should look (main content area, sidebar, etc).

{# _subpage.html #}
{% extends "_layout" %}

{% block content %}
  &lt;main&gt;
    {% block subpageContent %}{% endblock %}
  &lt;/main&gt;

  &lt;aside&gt;
    {% block subpageSidebar %}{% endblock %}
  &lt;/aside&gt;
{% endblock %}


Now I extend that _subpage.html in about.html and grab the blocks that belong to the _subpage.html template.

{# about.html #}
{% extends "_subpage" %}
{% set title = "About" %}

{% block subpageContent %}
  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae cupiditate suscipit, debitis accusantium tenetur impedit, veritatis id placeat, dolor hic temporibus architecto quas atque sunt officiis corrupti voluptatibus expedita. Assumenda!&lt;/p&gt;
{% endblock %}

{% block subpageSidebar %}
  &lt;li&gt;&lt;a href="#"&gt;Subpage Link 1&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#"&gt;Subpage Link 2&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#"&gt;Subpage Link 3&lt;/a&gt;&lt;/li&gt;
{% endblock %}


Now I realize you can use nested extends in Twig, but I'm entirely sure if I should. Is this a maintenance nightmare? Does it take a performance hit to do this? What's the best practice for template relationships?
I like to have the document skeleton with the head, scripts etc. in a _base.html template and if there's more than one basic page layout (think sidebars etc.) I additionally extend it with _layout-a.html, _layout-b.html, templates. Everything else I use includes for.

The templates are being transpiled down to PHP and cached, so there should not be any measurable performance influence really.