diff options
| author | Reorx <novoreorx@gmail.com> | 2022-06-02 11:44:11 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-06-02 11:44:11 +0800 |
| commit | a2a26eb189fb1355ad09fc0085c81214bc3bdfc1 (patch) | |
| tree | ddfd7e4a0aba12e0b14b09a9a856ccdd864d3946 /layouts/_default/_markup/render-image.html | |
| parent | 88b2584d06d6349089e96039b34de56187c99305 (diff) | |
update render-image to support video embed
just like embed an image, use 
Diffstat (limited to 'layouts/_default/_markup/render-image.html')
| -rw-r--r-- | layouts/_default/_markup/render-image.html | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 1aa9839..0fc039c 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -5,7 +5,16 @@ {{- end -}} {{- if $img -}} - <img loading="lazy" src="{{ $img.RelPermalink }}" alt="{{ $.Text }}" {{ with $.Title}} title="{{ . }}" {{ end }} /> + {{- 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 -}} + <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 -}} |
