File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed
hugo-modules/core/utils/asset
templates/theme-default/layouts/partials/components Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 27
27
{{- $alt := (or $params.alt $params.description) | default "" -}}
28
28
{{- $class_name := $params.class_name -}}
29
29
{{- $decoding := $params.decoding | default "async" -}}
30
- {{- $loading := cond (eq $params.lazy true) "lazy" ($params.loading | default false) -}}
30
+ {{- $loading := cond (eq $params.lazy true) "lazy" ($params.loading | default false) -}}
31
31
{{- $ratio := $params.ratio -}}
32
32
{{- $sizes := $params.sizes -}}
33
33
{{- $media := $params.media -}}
34
- {{- $preload := $params.preload | default false -}}
34
+ {{- $preload := $params.preload | default false -}}
35
35
36
36
{{- $image_attributes := partialCached "utils/html/attribute" (dict
37
37
"loading" $loading
42
42
{{- with $derivatives -}}
43
43
{{- $data := (index $derivatives "original") -}}
44
44
{{- with $ratio -}}
45
- {{- $data = (or (index $derivatives $ratio) (index $derivatives "original")) -}}
45
+ {{- $data = (or (index $derivatives $ratio) (index $derivatives "original")) -}}
46
46
{{- end -}}
47
47
{{- with $data -}}
48
48
{{- $srcsets := .srcsets -}}
Original file line number Diff line number Diff line change 27
27
{{- $alt := (or $params.alt $params.description) | default "" -}}
28
28
{{- $class_name := $params.class_name -}}
29
29
{{- $decoding := $params.decoding | default "async" -}}
30
- {{- $loading := cond (eq $params.lazy true) "lazy" ($params.loading | default false) -}}
30
+ {{- $loading := cond (eq $params.lazy true) "lazy" ($params.loading | default false) -}}
31
31
{{- $ratio := $params.ratio -}}
32
32
{{- $sizes := $params.sizes -}}
33
33
{{- $media := $params.media -}}
34
- {{- $preload := $params.preload | default false -}}
34
+ {{- $preload := $params.preload | default false -}}
35
35
36
36
{{- $image_attributes := partialCached "utils/html/attribute" (dict
37
37
"loading" $loading
42
42
{{- with $derivatives -}}
43
43
{{- $data := (index $derivatives "original") -}}
44
44
{{- with $ratio -}}
45
- {{- $data = (or (index $derivatives $ratio) (index $derivatives "original")) -}}
45
+ {{- $data = (or (index $derivatives $ratio) (index $derivatives "original")) -}}
46
46
{{- end -}}
47
47
{{- with $data -}}
48
48
{{- $srcsets := .srcsets -}}
Original file line number Diff line number Diff line change 28
28
{{- $controls := $params.controls | default false -}}
29
29
{{- $poster := $params.poster | default false -}}
30
30
{{- $muted := (or $autoplay $params.muted) -}}
31
- {{- $loading := cond (eq $params.lazy true) "lazy" ($params.loading | default false) -}}
32
- {{- $preload := $params.preload | default false -}}
31
+ {{- $loading := cond (eq $params.lazy true) "lazy" ($params.loading | default false) -}}
32
+ {{- $preload := $params.preload | default false -}}
33
33
{{- $media := $params.media -}}
34
34
35
35
{{- $attributes := partialCached "utils/html/attribute" (dict
Original file line number Diff line number Diff line change 10
10
{{- $media := $params.media -}}
11
11
{{- $caption := $params.caption -}}
12
12
13
- {{- $media_mobile := or (index $params (print "media_" $mobile_ratio)) $media -}}
14
- {{- $media_desktop := or (index $params (print "media_" $desktop_ratio)) $media -}}
13
+ {{- $media_mobile := or (index $params (print "media_" $mobile_ratio)) $media -}}
14
+ {{- $media_desktop := or (index $params (print "media_" $desktop_ratio)) $media -}}
15
15
16
16
{{- $different_ratios := (ne $mobile_ratio $desktop_ratio) -}}
17
17
{{- $only_img := and (hasPrefix ($media_mobile.mime_type | default "") "image") (hasPrefix ($media_desktop.mime_type | default "") "image") -}}
30
30
) -}}
31
31
{{- end -}}
32
32
{{- if $different_ratios -}}
33
- {{- if $only_img -}}
33
+ {{- if $only_img -}}
34
34
< picture class ="c-media__asset{{ with $class_name }} {{ . }}{{ end }} ">
35
35
{{- partial "utils/asset/image/sources" (dict
36
36
"globals" $globals
You can’t perform that action at this time.
0 commit comments