{{- $processImage := "" -}} {{- $lazyload := .Page.Site.Params.lazyload -}} {{- $imageZoom := .Page.Site.Params.imageZoom -}} {{- $public_cdn := cond .Page.Site.IsServer "" .Page.Site.Params.publicCDN -}} {{- $lazyload_image := print $public_cdn ("images/outload.svg" | relURL) -}} {{- $Permalink := .Destination | relURL | safeURL -}} {{- $Alt := .PlainText | safeHTML -}} {{- if (urls.Parse (.Destination | safeURL)).Scheme -}} {{- $processImage = partial "helper/image-process" (dict "Image" $Permalink "Site" .Page.Site) -}} {{- $Permalink = (replace $Permalink "{{timestamp}}" (delimit (shuffle (seq 1 9)) "")) -}} {{- else -}} {{- $Image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}} {{- $galleryImage := false -}} {{- $processImage = partial "helper/image-process" (dict "Image" $Image "Site" .Page.Site) -}} {{- if $processImage.Processed -}} {{- $galleryImage = true -}} {{- $Permalink = print $public_cdn $processImage.Permalink -}} {{- else -}} {{- $Permalink = print $public_cdn $Image -}} {{- end -}} {{- end -}}