diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 0b5f151..883dd9c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -10,11 +10,15 @@ {{- with .Params.images -}}{{ range first 1 . }} "image": { "@type": "ImageObject", - "url": "{{ . | absURL }}", - {{ with (imageConfig (printf "/static/%s" .)) }} + "url": "{{ . | absURL }}" + {{- /* Don't try to get imageConfig if image param is not local */ -}} + {{- if not (or (hasPrefix . "http://") (hasPrefix . "https://")) -}} + {{- with (imageConfig (printf "/static/%s" .)) -}} + , "height": "{{ .Height }}", "width": "{{ .Width }}" {{ end }} + {{ end }} }, {{- end -}}{{ end }} "url": "{{ printf "%s" .Permalink }}",