diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 1c07a10ad..05ef3a33b 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -5,13 +5,23 @@ {{ else }} {{ $img600 := $img.Fit "1000x800" }} -{{ $img1200 := $img.Fit "2000x1600" }} + +{{ $imgRetina := "" }} +{{ if and (lt $img.Width 2000) (lt $img.Height 1600)}} +{{ warnf "high density pixel image cannot be generated for <%s>" ($.Page.RelPermalink) }} +{{ else }} +{{ $imgRetina = $img.Fit "2000x1600" }} +{{ end }}