File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ <h2 class="article-title">
2323 "src" $image.Permalink
2424 "alt" .Title
2525 "loading" "lazy"
26+ "width" $image.Width
27+ "height" $image.Height
2628 )
2729 ) }}
2830 </ div >
Original file line number Diff line number Diff line change 1212 "src" $image.Permalink
1313 "alt" (printf "Featured image of post %s" .context.Title)
1414 "loading" "lazy"
15+ "width" $image.Width
16+ "height" $image.Height
1517 )
1618 ) }}
1719 </ div >
Original file line number Diff line number Diff line change 1111{{- $width := .Width -}}
1212{{- $height := .Height -}}
1313{{- $resize := .Resize -}}
14- {{- $attributes := merge (dict "width" $width "height" $height) .Attributes -}}
14+ {{- $attributes := .Attributes -}}
1515
1616{{- if and $resize $resource (reflect.IsImageResourceProcessable $resource) $width $height -}}
1717 {{/* Create thumbnail with 1x/2x descriptors */}}
3030 {{- end -}}
3131
3232 {{- if gt (len $srcset) 0 -}}
33- {{- $attributes = merge $attributes (dict "srcset" (delimit $srcset ", ")) -}}
33+ {{- $attributes = merge $attributes (dict "width" $width "height" $height " srcset" (delimit $srcset ", ")) -}}
3434 {{- end -}}
3535{{- end -}}
3636
You can’t perform that action at this time.
0 commit comments