diff options
Diffstat (limited to 'layouts/_default/_markup/render-image.html')
-rw-r--r-- | layouts/_default/_markup/render-image.html | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 0325458..0ed5584 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -25,22 +25,17 @@ {{- end -}} {{- end -}} -<figure +<img src="{{ $Permalink }}" + {{ with $Width }}width="{{ . }}"{{ end }} + {{ with $Height }}height="{{ . }}"{{ end }} + {{ with $Srcset }}srcset="{{ . }}"{{ end }} + loading="lazy" + {{ with $alt }} + alt="{{ . }}" + {{ end }} {{ if $galleryImage }} class="gallery-image" - style=" - flex-grow: {{ div (mul $image.Width 100) $image.Height }}; - flex-basis: {{ div (mul $image.Width 240) $image.Height }}px" - {{ end }}> - <a href="{{ $Permalink }}" {{ if $galleryImage }}data-size="{{ $image.Width }}x{{ $image.Height }}"{{ end }}> - <img src="{{ $Permalink }}" - {{ with $Width }}width="{{ . }}"{{ end }} - {{ with $Height }}height="{{ . }}"{{ end }} - {{ with $Srcset }}srcset="{{ . }}"{{ end }} - loading="lazy" - {{ with $alt }}alt="{{ . }}"{{ end }}> - </a> - {{ with $alt }} - <figcaption>{{ . | markdownify }}</figcaption> + data-flex-grow="{{ div (mul $image.Width 100) $image.Height }}" + data-flex-basis="{{ div (mul $image.Width 240) $image.Height }}px" {{ end }} -</figure>
\ No newline at end of file +>
\ No newline at end of file |