{% set logo = theme_var(mobile ? 'custom_logo_mobile' : 'custom_logo') %}
{% set logo_first = (logo is iterable and logo|length > 0) ? logo|first : null %}
{% set logo_file = logo_first.name|default(null) %}
<a href="{{ home_url }}" class="navbar-brand" aria-label="{{ site.title }}" title="{{ site.title }}">
{% if logo_file %}
    {% if logo_file|lower ends with '.svg' %}
        {{ svg_image('theme://images/logo/' ~ logo_file)|raw }}
    {% else %}
        <img src="{{ url('theme://images/logo/' ~ logo_file) }}" alt="{{ site.title }}" />
    {% endif %}
{% else %}
    {% include '@images/grav-logo.svg' ignore missing %}
{% endif %}
</a>
