From 0862b2b31c08002f9037fc2cad5ea184884f24a4 Mon Sep 17 00:00:00 2001 From: welpo Date: Fri, 4 Apr 2025 23:56:35 +0200 Subject: [PATCH] Don't render empty
tags --- templates/partials/hcard.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/templates/partials/hcard.html b/templates/partials/hcard.html index d5f652d..1b191bd 100644 --- a/templates/partials/hcard.html +++ b/templates/partials/hcard.html @@ -56,15 +56,18 @@ {# additional properties #} -
+ {% set dl_started = false %} {% for key, value in hcard %} - {# exclude all properties previously displayed #} - {% if key not in ['enable', 'with_mail', 'with_social_links', 'homepage', 'full_name', 'avatar', 'biography', 'p_nickname'] %} + {% if key not in ['enable', 'with_mail', 'with_social_links', 'homepage', 'full_name', 'avatar', 'biography', 'p_nickname'] %} + {% if not dl_started %} +
+ {% set dl_started = true %} + {% endif %}
{{ key | replace(from="p_", to="") | replace(from="u_", to="") | replace(from="dt_", to="") | replace(from="_", to=" ") | capitalize }}
{{ value }}
{% endif %} {% endfor %} -
- - + {% if dl_started %} +
+ {% endif %} {% endif %}