Prechádzať zdrojové kódy

fix: 55228b7ade0412796bae15eb122307ebd166d68a

Fix figure images not loading when not within page bundle.
George Cushen 5 rokov pred
rodič
commit
7b4470ebb5
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      layouts/shortcodes/figure.html

+ 3 - 1
layouts/shortcodes/figure.html

@@ -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 }}