diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000000..44d9597a96 --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1,11 @@ +{{- $dest_url := urls.Parse .Destination }} +{{- $dest_path := $dest_url.Path }} +{{- $image := .Page.Resources.GetMatch $dest_path }} +{{- $url := .Destination | relURL }} +{{- if $image }} + {{- $url = $image.RelPermalink }} + {{- if $dest_url.RawQuery }} + {{- $url = printf "%s?%s" $url $dest_url.RawQuery }} + {{- end }} +{{- end }} +{{ .Text }}