{{- $imageRaw := .Get "image" | default (.Get "src") -}} {{- $alt := .Get "alt" | default "Live Photo" -}} {{- $videoRaw := .Get "video" | default (replaceRE "\\.(avif|webp|jpg|jpeg|png|gif)$" ".mp4" $imageRaw) -}} {{- $image := $imageRaw -}} {{- $video := $videoRaw -}} {{- if and $imageRaw (not (findRE "^(https?://|/)" $imageRaw)) -}} {{- with .Page.Resources.GetMatch $imageRaw -}} {{- $image = .RelPermalink -}} {{- end -}} {{- end -}} {{- if and $videoRaw (not (findRE "^(https?://|/)" $videoRaw)) -}} {{- with .Page.Resources.GetMatch $videoRaw -}} {{- $video = .RelPermalink -}} {{- end -}} {{- end -}} {{- $style := .Get "style" -}}