Skip to content

Commit ca81e24

Browse files
authored
fix fullscreen image bug (#164)
* check for valid image formats * prettier
1 parent 221b858 commit ca81e24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

_includes/item/child/image-gallery.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
Adds child image in a Spotlight gallery markup.
33
Ensure dependencies are added by including `gallery: true` in the layout front matter calling this include.
44
{% endcomment %}
5+
{% assign valid_formats = 'image/jpeg,image/jpg,image/png' | split: ',' %}
56
<a
67
class="spotlight gallery-img"
78
data-download="true"
89
title="{{ child.title | escape }}"
9-
href="{{ child.object_location | relative_url }}"
10+
{% if valid_formats contains child.format %}
11+
href="{{ child.object_location | relative_url }}"
12+
{% else %}
13+
href="{{ child.image_small | relative_url }}"
14+
{% endif %}
1015
>
1116
<img
1217
src="{{ child.image_small | relative_url }}"

0 commit comments

Comments
 (0)