diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html index e92b555779..4ccd1910cf 100644 --- a/layouts/partials/cover.html +++ b/layouts/partials/cover.html @@ -9,7 +9,7 @@ {{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} {{- $cover := (or $pageBundleCover $globalResourcesCover)}} {{- if $cover -}}{{/* i.e it is present in page bundle */}} - {{- if $addLink }}{{ end -}} {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} @@ -22,8 +22,8 @@ {{- if (ge $cover.Width $size) -}} {{ printf "%s %s" (($cover.Resize (printf "%sx" $size)).Permalink) (printf "%sw ," $size) -}} {{ end }} - {{- end -}}{{$cover.Permalink }} {{printf "%dw" ($cover.Width)}}" - sizes="(min-width: 768px) 720px, 100vw" src="{{ $cover.Permalink }}" alt="{{ $alt }}" + {{- end -}}{{$cover.Permalink }} {{printf "%dw" ($cover.Width)}}" + sizes="(min-width: 768px) 720px, 100vw" src="{{ $cover.Permalink }}" alt="{{ $alt }}" width="{{ $cover.Width }}" height="{{ $cover.Height }}"> {{- else }}{{/* Unprocessable image or responsive images disabled */}} {{ $alt }}