diff options
Diffstat (limited to 'layouts/_default/_markup/render-image.html')
-rw-r--r-- | layouts/_default/_markup/render-image.html | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html deleted file mode 100644 index 4a44740..0000000 --- a/layouts/_default/_markup/render-image.html +++ /dev/null @@ -1,36 +0,0 @@ -{{ $image := "" -}} -{{ if (urls.Parse .Destination).IsAbs }} - {{ $image = resources.GetRemote .Destination -}} -{{ else -}} - {{ $image = .Page.Resources.GetMatch .Destination -}} -{{ end -}} -{{ with $image -}} - {{ $lqip := $image.Resize site.Params.lqipWidth -}} - - {{ $imgSrc := "" -}} - {{ $imgSrcSet := slice -}} - - {{ $widths := site.Params.landscapePhotoWidths -}} - {{ if gt $image.Height $image.Width -}} - {{ $widths = site.Params.portraitPhotoWidths -}} - {{ end -}} - - {{ range $widths -}} - {{ $srcUrl := (printf "%dx" . | $image.Resize).Permalink -}} - {{ if eq $imgSrc "" -}}{{ $imgSrc = $srcUrl -}}{{ end -}} - {{ $imgSrcSet = $imgSrcSet | append (printf "%s %dw" $srcUrl .) -}} - {{ end -}} - {{ $imgSrcSet = (delimit $imgSrcSet ",") -}} - - {{ if gt $image.Width site.Params.smallLimit -}} - <figure class="figure"> - <img class="figure-img img-fluid lazyload blur-up" data-sizes="auto" src="{{ $lqip.Permalink }}" data-srcset="{{ $imgSrcSet }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ $.Text }}"> - <noscript><img class="figure-img img-fluid" sizes="100vw" srcset="{{ $imgSrcSet }}" src="{{ $image.Permalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ $.Text }}"></noscript> - {{ with $.Title }}<figcaption class="figure-caption">{{ . | safeHTML }}</figcaption>{{ end -}} - </figure> - {{ else -}} - <img class="img-fluid lazyload blur-up" src="{{ $lqip.Permalink }}" data-src="{{ $image.Permalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ $.Text }}"> - {{ end -}} -{{ else -}} - {{ erroridf "image-not-found" "Image not found" -}} -{{ end -}}
\ No newline at end of file |