added explicit width,height to images

This commit is contained in:
Parker TenBroeck 2026-01-23 09:37:36 -05:00
parent aecbbcf022
commit dd3c0d87d8
3 changed files with 11 additions and 3 deletions

View file

@ -56,6 +56,10 @@ a {
} }
} }
img,video {
background-color: var(--grey-dark);
}
h1, h1,
h2, h2,
h3, h3,

View file

@ -6,9 +6,9 @@
<br><br> <br><br>
<div class="gallery"> <div class="gallery">
{% for page in section.pages -%} {% for page in section.pages -%}
{% set image = resize_image(path=page.extra.picture_src, width=260, height=180, op="fit_width") %} {% set image = resize_image(path=page.extra.picture_src, width=260*2, height=180*2, op="fit_width", format="avif") %}
<a href="{{ page.permalink }}"> <a href="{{ page.permalink }}">
<img src="{{ image.url }}" alt="{{page.description}}" fetchpriority=high /> <img src="{{ image.url }}" height="{{image.height}}" width="{{image.width}}" alt="{{page.description}}" fetchpriority=high />
</a> </a>
{%- endfor %} {%- endfor %}
</div> </div>

View file

@ -1,6 +1,9 @@
{% macro image(src, caption, class="") %} {% macro image(src, caption, class="") %}
{% set mdata = get_image_metadata(path=src) %}
{# {% set image = resize_image(path=src, height=mdata.height, width=mdata.width, format="webp") %} #}
<figure class="{% if class %} {{ class }} {% endif %}"> <figure class="{% if class %} {{ class }} {% endif %}">
<img src="{{ get_url(path=src) }}" loading="lazy" alt="{{caption | default(value='')}}" decoding="async" class="zoomable"> <img src="{{ src }}" loading="lazy" alt="{{caption | default(value='')}}" decoding="async" class="zoomable">
{% if caption != "" %} {% if caption != "" %}
<figcaption>{{ caption | markdown() | safe }}</figcaption> <figcaption>{{ caption | markdown() | safe }}</figcaption>
{% endif %} {% endif %}
@ -10,6 +13,7 @@
{% macro video(src, caption, loop=false, controls=true, autoplay=false, poster="", class="") %} {% macro video(src, caption, loop=false, controls=true, autoplay=false, poster="", class="") %}
<figure class="{% if class %} {{ class }} {% endif %}"> <figure class="{% if class %} {{ class }} {% endif %}">
<video <video
{% if poster %} poster="{{ poster }}"{% endif %} {% if poster %} poster="{{ poster }}"{% endif %}