Skip to content

Commit

Permalink
fix fullscreen image bug (#164)
Browse files Browse the repository at this point in the history
* check for valid image formats

* prettier
  • Loading branch information
koilebeit authored Oct 21, 2024
1 parent 221b858 commit ca81e24
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion _includes/item/child/image-gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
Adds child image in a Spotlight gallery markup.
Ensure dependencies are added by including `gallery: true` in the layout front matter calling this include.
{% endcomment %}
{% assign valid_formats = 'image/jpeg,image/jpg,image/png' | split: ',' %}
<a
class="spotlight gallery-img"
data-download="true"
title="{{ child.title | escape }}"
href="{{ child.object_location | relative_url }}"
{% if valid_formats contains child.format %}
href="{{ child.object_location | relative_url }}"
{% else %}
href="{{ child.image_small | relative_url }}"
{% endif %}
>
<img
src="{{ child.image_small | relative_url }}"
Expand Down

0 comments on commit ca81e24

Please sign in to comment.