mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 09:43:06 +00:00
11 lines
412 B
HTML
11 lines
412 B
HTML
{{- $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 }}
|
|
<img src="{{ $url }}" alt="{{ .Text }}"{{ with .Title}} title="{{ . }}"{{ end }}>
|