My personal website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
875 B

<!-- This shortcode renders an HTML video based on a page resource -->
{{- $filename := .Get "src" -}}
{{- $video := .Page.Resources.GetMatch (printf "%s" $filename) -}}
{{- $autoplay := default false (.Get "autoplay") -}}
{{- $loop := default false (.Get "loop") -}}
{{- $muted := default false (.Get "muted") -}}
{{- $controls := default false (.Get "controls") -}}
{{- $preload := default "metadata" (.Get "preload") -}}
{{- $height := .Get "height" -}}
{{- $width := .Get "width" -}}
<video
{{- with $autoplay }} autoplay{{ end -}}
{{- with $loop }} loop{{ end -}}
{{- with $muted }} muted{{ end -}}
{{- with $controls }} controls{{ end -}}
{{- with $preload }} preload="{{ . }}"{{ end -}}
{{- with $height }} height="{{ . }}"{{ end -}}
{{- with $width }} width="{{ . }}"{{ end -}}
>
<source src="{{ $video.RelPermalink }}" type="{{ $video.MediaType.Type }}">
</video>