update render-image to support video embed
just like embed an image, use ![](/path/to/video.mov)
This commit is contained in:
parent
88b2584d06
commit
a2a26eb189
|
@ -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 -}}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<figure>
|
||||
<video class="video-shortcode" preload="{{ .Get "preload" }}" controls>
|
||||
<source src="{{ .Get "src" }}" type="{{ .Get "type" }}">
|
||||
There should have been a video here but your browser does not seem
|
||||
to support it.
|
||||
There should have been a video here but your browser does not seem to support it.
|
||||
</video>
|
||||
</figure>
|
||||
|
|
Loading…
Reference in New Issue