image optimisation #4

Merged
TimJ merged 5 commits from develop into master 2024-11-06 13:44:24 +00:00
19 changed files with 2 additions and 2 deletions
Showing only changes of commit 70942a402f - Show all commits

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

View file

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -5,12 +5,12 @@
{{- with $mainPath := .Get 0 }} {{- with $mainPath := .Get 0 }}
{{- with $i := resources.Get (printf "%s%s" $imgpath $mainPath) }} {{- with $i := resources.Get (printf "%s%s" $imgpath $mainPath) }}
{{ $resizedImage := $i.Process "resize 720x" }} {{ $resizedImage := $i.Process "resize 1920x" }}
<picture class="{{ $class}}"> <picture class="{{ $class}}">
{{ $smallpath := "images/small/" }} {{ $smallpath := "images/small/" }}
{{- with $smallImage := resources.Get (printf "%s%s" $smallpath $mainPath ) }} {{- with $smallImage := resources.Get (printf "%s%s" $smallpath $mainPath ) }}
{{ $smallResized := $smallImage.Process "resize 720x" }} {{ $smallResized := $smallImage.Process "resize 1080x" }}
<source srcset="{{ $smallResized.RelPermalink }}" media="(max-width: 768px)"> <source srcset="{{ $smallResized.RelPermalink }}" media="(max-width: 768px)">
{{- end}} {{- end}}
<img src="{{ $resizedImage.RelPermalink }}" alt="{{ $alt }}"> <img src="{{ $resizedImage.RelPermalink }}" alt="{{ $alt }}">