Fix zoom in bibliography images (#3057)

Fixes #2668

Signed-off-by: George Araújo <george.gcac@gmail.com>
This commit is contained in:
George 2025-03-11 11:34:58 -03:00 committed by GitHub
parent 74beacb274
commit d53297f256
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 14 deletions

View File

@ -14,20 +14,22 @@
https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images for info on defining 'sizes' for responsive images
-->
{% if site.imagemagick.enabled %}
<source
class="responsive-img-srcset"
{% if ext == 'gif' or ext == 'jpeg' or ext == 'jpg' or ext == 'png' or ext == 'tiff' %}
srcset="{% for i in site.imagemagick.widths %}{{ img_path | relative_url }}-{{ i }}.webp {{ i }}w,{% endfor %}"
type="image/webp"
{% else %}
srcset="{{ include.path | relative_url }}"
{% endif %}
{% if include.sizes %}
sizes="{{ include.sizes }}"
{% else %}
sizes="95vw"
{% endif %}
>
{% unless include.avoid_scaling %}
<source
class="responsive-img-srcset"
{% if ext == 'gif' or ext == 'jpeg' or ext == 'jpg' or ext == 'png' or ext == 'tiff' %}
srcset="{% for i in site.imagemagick.widths %}{{ img_path | relative_url }}-{{ i }}.webp {{ i }}w,{% endfor %}"
type="image/webp"
{% else %}
srcset="{{ include.path | relative_url }}"
{% endif %}
{% if include.sizes %}
sizes="{{ include.sizes }}"
{% else %}
sizes="95vw"
{% endif %}
>
{% endunless %}
{% endif %}
<img
src="{% if include.url %}{{ include.url }}{% elsif include.cache_bust %}{{ include.path | relative_url | bust_file_cache }}{% else %}{{ include.path | relative_url }}{% endif %}"

View File

@ -37,6 +37,7 @@
sizes = "200px"
class="preview z-depth-1 rounded"
zoomable=true
avoid_scaling=true
alt=entry.preview
%}
{% endif %}