<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
    {% if data.show_indicators %}
        <ol class="carousel-indicators">
            {% for slide in data.slides %}
                <li data-target="#carouselExampleIndicators" data-slide-to="{{ forloop.counter }}"{% if forloop.first %} class="active"{% endif %}></li>
            {% endfor %}
        </ol>
    {% endif %}
    <div class="carousel-inner">
        {% for slide in data.slides %}
            <div class="carousel-item{% if forloop.first %} active{% endif %}">
                <img class="d-block w-100" src="{{ slide.image.url }}" alt="{{ slide.title }}">
                {% if data.show_title or data.show_caption %}
                    <div class="carousel-caption d-none d-md-block">
                        {% if data.show_title %}
                            <h5>{{ slide.title }}</h5>
                        {% endif %}
                        {% if data.show_caption %}
                            <p>{{ slide.caption }}</p>
                        {% endif %}
                    </div>
                {% endif %}
            </div>
        {% endfor %}
    </div>
    <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
    </a>
    <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
</div>