{{- $src := .Get "src" -}} {{- $id := .Get "id" -}} {{- $title := .Get "title" | default "Video" -}} {{- $class := .Get "class" | default "" -}} {{- if $id -}}
{{- else if $src -}} {{- $ext := $src | path.Ext -}} {{- $filetype := slicestr $ext 1 -}} {{- $videoURL := $src -}} {{- $resource := .Page.Resources.GetMatch $src -}} {{- if $resource -}}{{- $videoURL = $resource.RelPermalink -}}{{- end -}} {{- else -}} {{- errorf "video shortcode: either 'src' or 'id' parameter is required" -}} {{- end -}}