diff --git a/_layouts/post.html b/_layouts/post.html index a55031e..367def5 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -31,22 +31,6 @@ tail_includes: {% capture class %}class="preview-img{% if page.image.no_bg %}{{ ' no-bg' }}{% endif %}"{% endcapture %} {% capture alt %}alt="{{ page.image.alt | default: "Preview Image" }}"{% endcapture %} - {% capture w %} - {% if page.image.width %} - width="{{ page.image.width }}" - {% elsif page.image.w %} - width="{{ page.image.w }}" - {% endif %} - {% endcapture %} - - {% capture h %} - {% if page.image.height %} - height="{{ page.image.height }}" - {% elsif page.image.h %} - h="{{ page.image.h }}" - {% endif %} - {% endcapture %} - {% capture lqip %} {% if page.image.lqip %} lqip="{{ page.image.lqip }}" @@ -54,7 +38,7 @@ tail_includes: {% endcapture %}
- + {%- if page.image.alt -%}
{{ page.image.alt }}
{%- endif -%} diff --git a/_sass/layout/post.scss b/_sass/layout/post.scss index 146caba..ed7dcd8 100644 --- a/_sass/layout/post.scss +++ b/_sass/layout/post.scss @@ -34,6 +34,8 @@ @include align-center; @extend %preview-margin; + max-width: 100%; + &:not(.no-bg) { img.lazyloaded { background: var(--img-bg); @@ -41,6 +43,10 @@ } img { + aspect-ratio: 40 / 21; + -o-object-fit: cover; + object-fit: cover; + @extend %preview-margin; @extend %img-rounded; }