File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{{- $src := .Page.Resources.GetMatch (.Get "src") -}}
22{{- if $src -}}
3-
4- {{ $tinyw := default "500x" }}
5- {{ $smallw := default "800x" }}
6- {{ $mediumw := default "1200x" }}
7- {{ $largew := default "1500x" }}
8-
9- {{ .Scratch.Set "tiny" ($src.Resize $tinyw) }}
10- {{ .Scratch.Set "small" ($src.Resize $smallw) }}
11- {{ .Scratch.Set "medium" ($src.Resize $mediumw) }}
12- {{ .Scratch.Set "large" ($src.Resize $largew) }}
13-
14-
15- {{ $tiny := .Scratch.Get "tiny" }}
16- {{ $small := .Scratch.Get "small" }}
17- {{ $medium := .Scratch.Get "medium" }}
18- {{ $large := .Scratch.Get "large" }}
193< div class ="imageWrapper ">
204< img
21- {{ with .Get "sizes" }}sizes='{{.}} '{{ else }}sizes ="(min-width: 35em) 600px, 100vw "{{ end }}
22- srcset ='
23- {{ if ge $src.Width "500" }}
24- {{ with $tiny.RelPermalink }}{{.}} 500w{{ end }}
25- {{ end }}
26- {{ if ge $src.Width "800" }}
27- {{ with $small.RelPermalink }}, {{.}} 800w{{ end }}
28- {{ end }} '
29- {{ if .Get (print $medium) }}
30- src ="{{ $medium.RelPermalink }} "
31- width = "100% "
32- {{ else }}
33- src ="{{ $src.RelPermalink }} "
34- {{ end }}
5+ src ="{{ $src.RelPermalink }} "
6+ width = "100% "
357 />
368</ div >
379
You can’t perform that action at this time.
0 commit comments