Render a Twig block inside the same template

Code
<?php

$path = __DIR__ . '/templates/';

$template = <<<ND
{% extends "base.html.twig" %}

{% block body %}
    {{ block("part") }}
    <p><strong>regular content</strong></p>
    {{ block("part") }}
{% endblock %}

{% block part %}
    repeating content
{% endblock %}
ND;
$name = 'string.html.twig';

$loaders = [
    new Twig\Loader\ArrayLoader([$name => $template]),
    new Twig\Loader\FilesystemLoader($path),
];
$loader = new Twig\Loader\ChainLoader($loaders);

$twig = new Twig\Environment($loader);

echo $twig->render($name);
Result

This is the Twig base template


The embedded template:

repeating content

regular content


repeating content