From 9551983df7b421901cb1641506ec9c943c990b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Couto?= Date: Thu, 1 Oct 2015 16:15:21 +0100 Subject: [PATCH] Fix #28. Allow directives with the same name. --- templates/site.j2 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/site.j2 b/templates/site.j2 index 8608c08..594b752 100644 --- a/templates/site.j2 +++ b/templates/site.j2 @@ -2,14 +2,26 @@ server { {% for k,v in item.server.iteritems() %} {% if k.find('location') == -1 and k != 'name' %} +{% if v is not string and v is iterable %} +{% for lv in v %} + {{ k }} {{ lv }}; +{% endfor %} +{% else %} {{ k }} {{ v }}; {% endif %} +{% endif %} {% endfor %} {% for k,v in item.server.iteritems() if k.find('location') != -1 %} location {{ v.name }} { {% for x,y in v.iteritems() if x != 'name' %} +{% if y is not string and y is iterable %} +{% for ly in y %} + {{ x }} {{ ly }}; +{% endfor %} +{% else %} {{ x }} {{ y }}; +{% endif %} {% endfor %} } {% endfor %}