summaryrefslogtreecommitdiff
path: root/templates/lib/img_cluster.html
blob: 8117298b7c28ff676373ee6be7f9fd97cda4f453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{% load get_image_by_size %}{%if cluster_class != "picwide"%}<span class="{{cluster_class}}">{%endif%}
{% if caption %}<figure {%if cluster_class != "picwide"%}class="{{cluster_class}}"{%endif%}>{%endif%}
    <a href="{%get_image_by_size image "original"%}" title="view larger image">
        <img {%if cluster_class == "picwide"%} class="picwide"
                        sizes="(max-width: 1439px) 100vw, (min-width: 1440px) 1440px" srcset="{% for size in image.sizes.all%}{% get_image_by_size image size.slug %} {{size.width}}w{% if forloop.last%}"{%else%}, {%endif%}{%endfor%}
                        {% for size in image.sizes.all%}{%if not forloop.first and not forloop.last%} src="{% get_image_by_size image size.slug%}"{%endif%}{%endfor%}
                    {%else%}
                    src="{% get_image_by_size image cluster_class %}"
                    {%endif%}
                    alt="{%if image.alt %}{{image.alt}}{%else%}{{image.title}}{%endif%} by {% if image.photo_credit_source %}{{image.photo_credit_source}}{%else%}Scott Gilbertson{%endif%}"></a>
                    {% if caption %}<figcaption>{{image.caption|safe}}</figcaption></figure>
{% endif %}
    {%if cluster_class != "picwide"%}</span>{%endif%}