Merge pull request #1820 from Indevver/audit-23

changing images to responsive images with srcset
This commit is contained in:
Denise
2019-10-21 05:33:33 -07:00
committed by GitHub
81 changed files with 330 additions and 62 deletions
+17
View File
@@ -0,0 +1,17 @@
{{ $img := .Get 0 }}
{{ $alt := .Get 1 }}
{{ with resources.Get $img }}
{{ $thumb20 := .Resize "2000x" }}
{{ $thumb16 := .Resize "1600x" }}
{{ $thumb12 := .Resize "1200x" }}
{{ $thumb10 := .Resize "1000x" }}
{{ $thumb8 := .Resize "800x" }}
{{ $thumb6 := .Resize "600x" }}
{{ $thumb4 := .Resize "400x" }}
{{ $thumb2 := .Resize "200x" }}
<img
srcset="{{ $thumb2.Permalink }} 200w, {{ $thumb4.Permalink }} 400w, {{ $thumb6.Permalink }} 600w, {{ $thumb8.Permalink }} 800w, {{ $thumb10.Permalink }} 1000w, {{ $thumb12.Permalink }} 1200w, {{ $thumb16.Permalink }} 1600w, {{ $thumb20.Permalink }} 2000w"
src="{{ .Permalink }}"
alt ="{{$alt}}"
>
{{ end }}