{% if contacts %} 
<!-- wp:heading -->
<h2 id="contacts">Contacts</h2>
<!-- /wp:heading -->

<!-- wp:list -->
<ul>{% for term_name, terms in contacts.items() -%}
    {% for contact in terms %}
<li><strong>{{term_name|title}}</strong> {{contact.html}}</li>
{%- endfor %}
{%- endfor %}</ul>

<!-- /wp:list -->

{% endif %}