diff --git a/layouts/partials/blocks/templates/video.html b/layouts/partials/blocks/templates/video.html index 35b1a0491dc00b80bea43509628c5ab9f5a0461b..70288bcd394a30704da61c58f9fa671ff9194368 100644 --- a/layouts/partials/blocks/templates/video.html +++ b/layouts/partials/blocks/templates/video.html @@ -12,15 +12,22 @@ {{ end -}} {{ if .url }} - <div class="video"> - {{ $partial := printf "blocks/templates/video/%s" .video.platform }} - {{ partial $partial . }} - </div> - {{ end }} + {{ $title := "video" }} + {{ with .video_title }} + {{ $title = .}} + {{ end }} - {{ if .video_title }} - <p>{{- partial "PrepareHTML" .video_title -}}</p> - {{ end }} + <div class="video"> + {{ $partial := printf "blocks/templates/video/%s" .video.platform }} + {{ partial $partial ( dict + "context" . + "title" $title + )}} + </div> + {{ end }} + {{ if .video_title }} + <p>{{- partial "PrepareHTML" .video_title -}}</p> + {{ end }} {{ partial "commons/transcription" ( dict "transcription" .transcription diff --git a/layouts/partials/blocks/templates/video/dailymotion.html b/layouts/partials/blocks/templates/video/dailymotion.html index 220610b3dd336398b9f94850a8f7ccbc98fb3bf3..fd72332d0719fa5170ac4d8bf8275218f036e2cf 100644 --- a/layouts/partials/blocks/templates/video/dailymotion.html +++ b/layouts/partials/blocks/templates/video/dailymotion.html @@ -1,9 +1,11 @@ -{{ if .video.poster }} +{{ $title := .title }} + +{{ if .context.video.poster }} <div class="lazy-video-player"> <button class="lazy-video-player__play" title ="{{- i18n "blocks.video.play" -}}" aria-label="{{- i18n "blocks.video.play" -}}"></button> - <img src="{{ .video.poster }}" alt="{{ .video_title }}" loading="lazy"> + <img src="{{ .context.video.poster }}" alt="{{ .context.video_title }}" loading="lazy"> </div> {{ end }} <div class="video-container"> - <iframe data-unloaded-src="{{ .video.embed_with_defaults }}" title="{{ .video_title }}" autoplay="true" allow="autoplay; fullscreen"></iframe> + <iframe data-unloaded-src="{{ .context.video.embed_with_defaults }}" title="{{ .context.video_title }}" autoplay="true" allow="autoplay; fullscreen"></iframe> </div> \ No newline at end of file diff --git a/layouts/partials/blocks/templates/video/peertube.html b/layouts/partials/blocks/templates/video/peertube.html index 81157b5abec594283c777d57215c375529cf865e..7f04a10885bc0661969bd66f58b3a1401d64b710 100644 --- a/layouts/partials/blocks/templates/video/peertube.html +++ b/layouts/partials/blocks/templates/video/peertube.html @@ -1,6 +1,8 @@ +{{ $title := .title }} + <div class="lazy-video-player"> <button class="lazy-video-player__play" title ="{{- i18n "blocks.video.play" -}}" aria-label="{{- i18n "blocks.video.play" -}}"></button> </div> <div class="video-container"> - <iframe data-unloaded-src="{{ .video.embed_with_defaults }}" title="{{ .video_title }}" allow="autoplay; fullscreen"></iframe> + <iframe data-unloaded-src="{{ .context.video.embed_with_defaults }}" title="{{ .context.video_title }}" allow="autoplay; fullscreen"></iframe> </div> \ No newline at end of file diff --git a/layouts/partials/blocks/templates/video/vimeo.html b/layouts/partials/blocks/templates/video/vimeo.html index 724bee42bffbfbfff7da6ef6a98818486ca1accb..879f428b3816b560e73b667380de9088b1067de3 100644 --- a/layouts/partials/blocks/templates/video/vimeo.html +++ b/layouts/partials/blocks/templates/video/vimeo.html @@ -1,9 +1,11 @@ -{{ if .video.poster }} +{{ $title := .title }} + +{{ if .context.video.poster }} <div class="lazy-video-player"> <button class="lazy-video-player__play" title ="{{- i18n "blocks.video.play" -}}" aria-label="{{- i18n "blocks.video.play" -}}"></button> - <img src="{{ .video.poster }}" alt="{{ .video_title }}" loading="lazy"> + <img src="{{ .context.video.poster }}" alt="{{ .context.video_title }}" loading="lazy"> </div> {{ end }} <div class="video-container"> - <iframe data-unloaded-src="{{ .video.embed_with_defaults }}" title="{{ .video_title }}" allow="autoplay; fullscreen"></iframe> + <iframe data-unloaded-src="{{ .context.video.embed_with_defaults }}" title="{{ .context.video_title }}" allow="autoplay; fullscreen"></iframe> </div> \ No newline at end of file diff --git a/layouts/partials/blocks/templates/video/youtube.html b/layouts/partials/blocks/templates/video/youtube.html index 855f5147bec178b040a7e9cc8fd857c919554c13..3790acf35ad82eda9455f741f764dc3632a719bb 100644 --- a/layouts/partials/blocks/templates/video/youtube.html +++ b/layouts/partials/blocks/templates/video/youtube.html @@ -1,14 +1,11 @@ -{{ $title := "video" }} -{{ with .video_title }} - {{ $title = .}} -{{ end }} +{{ $title := .title }} -{{ if .video.poster }} +{{ if .context.video.poster }} <div class="lazy-video-player"> <button class="lazy-video-player__play" title ="{{- i18n "blocks.video.play" -}}" aria-label="{{- i18n "blocks.video.play" -}}"></button> - <img src="{{ .video.poster }}" alt="{{ .video_title }}" loading="lazy"> + <img src="{{ .context.video.poster }}" alt="{{ .context.video_title }}" loading="lazy"> </div> {{ end }} <div class="video-container"> - <iframe data-unloaded-src="{{ .video.embed_with_defaults }}" title="{{ $title }}" allowfullscreen allow="autoplay"></iframe> + <iframe data-unloaded-src="{{ .context.video.embed_with_defaults }}" title="{{ $title }}" allowfullscreen allow="autoplay"></iframe> </div> \ No newline at end of file