From 5fb449a8e7b2cf228be4dc8ec00108d61f56df3c Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Thu, 21 Oct 2021 13:35:43 -0500 Subject: [PATCH] Add srcset to images --- layouts/partials/figure.html | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/layouts/partials/figure.html b/layouts/partials/figure.html index 1d0804f..8afdffc 100644 --- a/layouts/partials/figure.html +++ b/layouts/partials/figure.html @@ -1,7 +1,31 @@
{{ $media := . | resources.Fingerprint "sha512" }} + {{ if eq .MediaType.MainType "image" }} - {{ $media.Title }} + + {{ $tiny := $media.Resize "500x" }} + {{ $small := $media.Resize "800x" }} + {{ $medium := $media.Resize "1200x" }} + {{ $large := $media.Resize "1500x" }} + {{ $media.Title }} + {{ else if eq .MediaType.MainType "video" }}