From 0f631dd1d559b4b974cf645c8f03a0312af61105 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Tue, 6 Aug 2019 12:38:55 +0200
Subject: [PATCH] Allow use of variables in custom content for templates

---
 src/Handler.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/Handler.php b/src/Handler.php
index 95eb50a..8e8f840 100644
--- a/src/Handler.php
+++ b/src/Handler.php
@@ -94,6 +94,11 @@ class Handler extends BaseHandler {
           /** @noinspection SlowArrayOperationsInLoopInspection */
           $yaml = array_merge_recursive($yaml, $options[$filename]);
           $rendered = Yaml::dump($yaml, 9, 2);
+
+          // Render the string again so that custom content can also use variables
+          $twig_loader->setTemplate($filename, $rendered);
+          $rendered = $twig->render($filename, $options);
+
         }
         if ($fs->exists($file)) {
           if (md5_file($file) === md5($rendered)) {
-- 
GitLab