summaryrefslogtreecommitdiff
path: root/layouts/_default/_markup/render-image.html
diff options
context:
space:
mode:
authorhyang <hyang@hyang.xyz>2024-01-06 23:01:40 -0800
committerhyang <hyang@hyang.xyz>2024-01-06 23:01:40 -0800
commita30c02a727cc62de36e9a061afc8fcc3704c4ff1 (patch)
tree9c52fdf64cdff445f4069b43fcd1c53bbe0489cc /layouts/_default/_markup/render-image.html
parent36156fa9a4a9a82faabb19b30c72ca262adf5e7f (diff)
p
Diffstat (limited to 'layouts/_default/_markup/render-image.html')
-rw-r--r--layouts/_default/_markup/render-image.html29
1 files changed, 0 insertions, 29 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
deleted file mode 100644
index 9bf57a9..0000000
--- a/layouts/_default/_markup/render-image.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{{- $url := urls.Parse .Destination -}}
-{{- if $url.Scheme -}}
- {{/* third party image */}}
- <img loading="lazy" src="{{ .Destination | safeURL }}" alt="{{ $.Text }}" {{ with $.Title}} title="{{ . }}" {{ end }} />
-{{- else -}}
- {{/* internal image */}}
- {{- $img := .Page.Resources.GetMatch .Destination -}}
- {{- if not $img -}}
- {{- $img = resources.Get .Destination -}}
- {{- end -}}
-
- {{- if $img -}}
- {{- if eq $img.MediaType.MainType "video" -}}
- <figure>
- <video class="video-shortcode" preload="metadata" controls>
- <source src="{{ $img.RelPermalink }}">
- There should have been a video here but your browser does not seem to support it.
- </video>
- </figure>
- {{- else -}}
- {{ if (and (not (eq $img.MediaType.SubType "svg")) (gt $img.Height 800)) }}
- {{ $img = $img.Resize "200x" }}
- {{ end }}
- <img loading="lazy" src="{{ $img.RelPermalink }}" type="" alt="{{ $.Text }}" {{ with $.Title}} title="{{ . }}" {{ end }} />
- {{- end -}}
- {{- else -}}
- {{- warnf "No image found for %s from %s" .Destination .Page.File }}
- {{- end -}}
-{{- end -}}