fix #54: root all image urls
parent
3b3e6ec3b2
commit
f192f9a23d
@ -0,0 +1,8 @@
|
||||
{{$src := .Destination | safeURL }}
|
||||
{{$external := strings.HasPrefix $src "http" }}
|
||||
{{- if $external -}}
|
||||
<img src="{{ $src }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
||||
{{- else -}}
|
||||
{{$fixedUrl := (cond (hasPrefix $src "/") $src (print "/" $src)) | urlize}}
|
||||
<img src="{{ $fixedUrl }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
||||
{{- end -}}
|
Loading…
Reference in New Issue