21 lines
668 B
HTML
21 lines
668 B
HTML
|
{{- $url := urls.Parse .Destination -}}
|
||
|
{{- $scheme := $url.Scheme -}}
|
||
|
|
||
|
<img src="
|
||
|
{{- if eq $scheme "" -}}
|
||
|
{{- $cleanedPath := strings.Replace $url.Path "\\" "/" -1 -}}
|
||
|
{{- if strings.HasSuffix $cleanedPath ".md" -}}
|
||
|
{{- relref .Page $cleanedPath | safeURL -}}
|
||
|
{{- else -}}
|
||
|
{{- printf "/%s%s" .Page.File.Dir $cleanedPath | safeURL -}}
|
||
|
{{- end -}}
|
||
|
{{- else -}}
|
||
|
{{- .Destination | safeURL -}}
|
||
|
{{- end -}}"
|
||
|
{{- with .Title }} title="{{ . | safeHTML }}"{{- end -}}
|
||
|
{{- with .Text }} alt="{{ . | safeHTML }}"
|
||
|
{{- end -}}
|
||
|
/>
|
||
|
|
||
|
{{- /* whitespace stripped here to avoid trailing newline in rendered result caused by file EOL */ -}}
|