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 -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if $img -}}
|
{{- 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 -}}
|
{{- else -}}
|
||||||
{{- warnf "No image found for %s from %s" .Destination .Page.File }}
|
{{- warnf "No image found for %s from %s" .Destination .Page.File }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<figure>
|
<figure>
|
||||||
<video class="video-shortcode" preload="{{ .Get "preload" }}" controls>
|
<video class="video-shortcode" preload="{{ .Get "preload" }}" controls>
|
||||||
<source src="{{ .Get "src" }}" type="{{ .Get "type" }}">
|
<source src="{{ .Get "src" }}" type="{{ .Get "type" }}">
|
||||||
There should have been a video here but your browser does not seem
|
There should have been a video here but your browser does not seem to support it.
|
||||||
to support it.
|
|
||||||
</video>
|
</video>
|
||||||
</figure>
|
</figure>
|
||||||
|
|
Loading…
Reference in New Issue