Fix figure images not loading when not within page bundle.
This commit is contained in:
George Cushen committed 2020-01-24 02:08:50 +00:00
1 parent c74f07dd01
commit 7b4470ebb5
1 file changed
+3 -1
+3 -1
View File
@@ -29,8 +29,10 @@
{{/* Lazy load only when we know image dimensions in order to preserve anchor linking. */}}
{{ if $asset }}
<img data-src="{{$image_src}}" class="lazyload" alt="{{ with .Get "alt" }}{{.}}{{end}}" width="{{ (.Get "width") | default $asset.Width }}" height="{{ (.Get "height") | default $asset.Height }}">
{{ else if and (.Get "width") (.Get "height") }}
<img data-src="{{$image_src}}" class="lazyload" alt="{{ with .Get "alt" }}{{.}}{{end}}" {{ with .Get "width" }}width="{{.}}"{{end}} {{ with .Get "height" }}height="{{.}}"{{end}}>
{{ else }}
<img data-src="{{$image_src}}" alt="{{ with .Get "alt" }}{{.}}{{end}}" {{ with .Get "width" }}width="{{.}}" {{end}}{{ with .Get "height" }}height="{{.}}" class="lazyload"{{end}}>
<img src="{{$image_src}}" alt="{{ with .Get "alt" }}{{.}}{{end}}" {{ with .Get "width" }}width="{{.}}"{{end}} {{ with .Get "height" }}height="{{.}}"{{end}}>
{{ end }}
{{- if or $lightbox (.Get "link") }}</a>{{ end }}