{% resource 'ckanext-nhm/external-links' %}

{% block external_links %}
    <section class="module additional-info">
        <div class="module-content external-links">
            <h3>{{ _('External Links') }}</h3>
            {% block external_links_content %}
                {% set external_links = h.get_external_links(record) %}
                {% if external_links %}
                    {% for text, icon, links in external_links %}
                        <div class="external-link-parent">
                            <div class="external-link-name">
                                <img width="16" height="16" src="{{ icon }}">&nbsp;<span>{{ text }}&nbsp;<i class="fas fa-caret-down"></i></span>
                            </div>
                            <ul>
                                {% for link_text, link in links %}
                                    <li class="external-link-child">
                                        <a href="{{ link }}" target="_blank" class="external">
                                            {{ link_text }}
                                        </a>
                                    </li>
                                {% endfor %}
                            </ul>
                        </div>
                    {% endfor %}
                {% endif %}
            {% endblock %}
        </div>
    </section>
{% endblock %}

{% resource 'ckanext-nhm/external-links' %}

{% block external_links %}
    <section class="module additional-info">
        <div class="module-content external-links">
            <h3>{{ _('External Links') }}</h3>
            {% block external_links_content %}
                {% set external_links = h.get_external_links(record) %}
                {% if external_links %}
                    {% for text, icon, links in external_links %}
                        <div class="external-link-parent">
                            <div class="external-link-name">
                                <img width="16" height="16" src="{{ icon }}" alt="{{ text }} icon">&nbsp;<span>{{ text }}&nbsp;<i class="fas fa-caret-down"></i></span>
                            </div>
                            <ul>
                                {% for link_text, link in links %}
                                    <li class="external-link-child">
                                        <a href="{{ link }}" target="_blank" class="external">
                                            {{ link_text }}
                                        </a>
                                    </li>
                                {% endfor %}
                            </ul>
                        </div>
                    {% endfor %}
                {% endif %}
            {% endblock %}
        </div>
    </section>
{% endblock %}

Add alt text to external link icons
[wcag] Add alt text to external link icons
