You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
507 B
HTML
10 lines
507 B
HTML
{{$src := .Destination | safeURL }}
|
|
{{$width := index (split .Text "|") 1 | default "auto" }}
|
|
{{$external := strings.HasPrefix $src "http" }}
|
|
{{- if $external -}}
|
|
<img src="{{ $src }}" width="{{ $width }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
|
{{- else -}}
|
|
{{$fixedUrl := (cond (hasPrefix $src "/") $src (print "/" $src)) | urlize}}
|
|
<img src="{{.Page.Site.BaseURL}}{{ $fixedUrl }}" width="{{ $width }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
|
{{- end -}}
|