diff --git a/layouts/shortcodes/linkpreview.html b/layouts/shortcodes/linkpreview.html index 46817b6d..bea3b8e0 100644 --- a/layouts/shortcodes/linkpreview.html +++ b/layouts/shortcodes/linkpreview.html @@ -86,8 +86,11 @@ {{- end -}} {{- end -}} {{- else -}} - {{- $thumbnail := resources.Get $.Site.Params.defaultNoimage -}} - {{- $thumbnail_url = ($thumbnail.Fit (printf "800x400 center q%d webp" $imageQuality)).Permalink -}} + {{- with $thumbnail := resources.Get $.Site.Params.defaultNoimage -}} + {{- if $thumbnail -}} + {{- $thumbnail_url = ($thumbnail.Fit (printf "800x400 center q%d webp" $imageQuality)).Permalink -}} + {{- end -}} + {{- end -}} {{- end -}} @@ -99,8 +102,8 @@ {{- end -}} {{- end -}} - {{- $title -}} - {{- $description | plainify | safeHTML -}} + {{- $title | htmlUnescape -}} + {{- $description | plainify | htmlUnescape | safeHTML -}} {{ $url.Host }}
{{- $description | plainify | safeHTML -}}
{{- $description | plainify | htmlUnescape | safeHTML -}}