File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 55
55
{{- end -}}
56
56
{{- else -}}
57
57
{{- with $url -}}
58
- {{- $src := $params.src | default (cond (hasPrefix . "//") (print "https:" .) .) -}}
58
+ {{- $absUrl := partial "utils/get-abs-url" . -}}
59
+ {{- $src := $params.src | default $absUrl -}}
59
60
< img src ="{{- $src -}} " width ="{{- $width -}} " height ="{{- $height -}} " {{ $image_attributes }} alt ="{{- $alt -}} "{{ with $params.preload }} fetchpriority ="high "{{ end }} >
60
61
{{/* Add preload hint here as we have no srcset available */}}
61
62
{{- $preload_attr := (dict
Original file line number Diff line number Diff line change 9
9
10
10
{{/* context is url */}}
11
11
{{ if partialCached "utils/reflect/is-string" . . }}
12
- {{ $href := cond (and (hasPrefix . "//") (not (hasPrefix . "//localhost")) ) (print "https:" . ) . }}
12
+ {{ $href := partial "utils/get-abs-url" . }}
13
13
{{ $return = (dict "href" $href) }}
14
14
{{/* Add target="_blank" and rel="noreferrer" for external links */}}
15
15
{{ if (and (in . "//") (not (in . site.BaseURL))) }}
Original file line number Diff line number Diff line change 54
54
{{ end }}
55
55
{{ end }}
56
56
{{ with .url }}
57
- {{ $src = cond (hasPrefix . "//") (print "https:" .) . }}
57
+ {{ $src := partial "utils/get-abs-url" . }}
58
58
{{ with resources.GetRemote $src }}
59
59
{{ $src = .RelPermalink }}
60
60
{{ $source = .Content }}
You can’t perform that action at this time.
0 commit comments