{{ $autoplay := .Get "autoplay" -}} {{ $caption := .Get "caption" -}} {{ $class := .Get "class" -}} {{ $loop := .Get "loop" -}} {{ $poster := .Get "poster" -}} {{ $preload := .Get "preload" | default "metadata" -}} {{ $src := .Get "src" -}} {{ $width := .Get "width" -}} {{ $posterres := false -}} {{ $resource := false -}} {{ $static := false -}} {{ $type := false -}} {{ if and $poster (fileExists (path.Join "/static" $poster)) -}} {{ $poster = relURL $poster -}} {{ else if $poster -}} {{ $poster = strings.TrimLeft "/" $poster -}} {{ with resources.Get $poster -}} {{ $posterres = . -}} {{ end -}} {{ with .Page.Resources.Get $poster -}} {{ $posterres = . -}} {{ end -}} {{ end -}} {{ if $posterres -}} {{ if $width -}} {{ $image := $posterres.Resize (printf "%sx" $width) -}} {{ $poster = $image.RelPermalink -}} {{ else -}} {{ $poster = $posterres.RelPermalink -}} {{ end -}} {{ end -}} {{ if not $src -}} {{ warnf "%s shortcode number %d in \"content/%s\" is missing the \"src\" attribute." .Name .Ordinal .Page.File.Path -}} {{ end -}} {{ $slug := .Page.Slug }}
{{ with $caption -}}
{{ . | .Page.RenderString }}
{{ end -}}