From c118b2ad5769c350bc9cf9fadcd87953da3c9037 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Thu, 12 Oct 2023 07:51:35 +0200 Subject: [PATCH] fix --- layouts/partials/blocks/templates/video.html | 5 +---- .../blocks/templates/video/dailymotion.html | 16 +++++++--------- .../blocks/templates/video/peertube.html | 4 +--- .../partials/blocks/templates/video/vimeo.html | 16 +++++++--------- .../partials/blocks/templates/video/youtube.html | 16 +++++++--------- 5 files changed, 23 insertions(+), 34 deletions(-) diff --git a/layouts/partials/blocks/templates/video.html b/layouts/partials/blocks/templates/video.html index 0201e604..d2b7a939 100644 --- a/layouts/partials/blocks/templates/video.html +++ b/layouts/partials/blocks/templates/video.html @@ -20,10 +20,7 @@ <div class="video"> {{ $partial := printf "blocks/templates/video/%s" .video.platform }} - {{ partial $partial ( dict - "context" . - "title" $title - )}} + {{ partial $partial . }} </div> {{ end }} diff --git a/layouts/partials/blocks/templates/video/dailymotion.html b/layouts/partials/blocks/templates/video/dailymotion.html index fd72332d..bc36c9b1 100644 --- a/layouts/partials/blocks/templates/video/dailymotion.html +++ b/layouts/partials/blocks/templates/video/dailymotion.html @@ -1,11 +1,9 @@ -{{ $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="{{ .context.video.poster }}" alt="{{ .context.video_title }}" loading="lazy"> - </div> -{{ end }} +<div class="lazy-video-player"> + <button class="lazy-video-player__play" title ="{{- i18n "blocks.video.play" -}}" aria-label="{{- i18n "blocks.video.play" -}}"></button> + {{ if .video.poster }} + <img src="{{ .video.poster }}" alt="{{ .video.title }}" loading="lazy"> + {{ end }} +</div> <div class="video-container"> - <iframe data-unloaded-src="{{ .context.video.embed_with_defaults }}" title="{{ .context.video_title }}" autoplay="true" allow="autoplay; fullscreen"></iframe> + <iframe data-unloaded-src="{{ .video.embed_with_defaults }}" title="{{ .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 7f04a108..1b879da0 100644 --- a/layouts/partials/blocks/templates/video/peertube.html +++ b/layouts/partials/blocks/templates/video/peertube.html @@ -1,8 +1,6 @@ -{{ $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="{{ .context.video.embed_with_defaults }}" title="{{ .context.video_title }}" allow="autoplay; fullscreen"></iframe> + <iframe data-unloaded-src="{{ .video.embed_with_defaults }}" title="{{ .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 879f428b..8127b3b3 100644 --- a/layouts/partials/blocks/templates/video/vimeo.html +++ b/layouts/partials/blocks/templates/video/vimeo.html @@ -1,11 +1,9 @@ -{{ $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="{{ .context.video.poster }}" alt="{{ .context.video_title }}" loading="lazy"> - </div> -{{ end }} +<div class="lazy-video-player"> + <button class="lazy-video-player__play" title ="{{- i18n "blocks.video.play" -}}" aria-label="{{- i18n "blocks.video.play" -}}"></button> + {{ if .video.poster }} + <img src="{{ .video.poster }}" alt="{{ .video.title }}" loading="lazy"> + {{ end }} +</div> <div class="video-container"> - <iframe data-unloaded-src="{{ .context.video.embed_with_defaults }}" title="{{ .context.video_title }}" allow="autoplay; fullscreen"></iframe> + <iframe data-unloaded-src="{{ .video.embed_with_defaults }}" title="{{ .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 3790acf3..9cd02195 100644 --- a/layouts/partials/blocks/templates/video/youtube.html +++ b/layouts/partials/blocks/templates/video/youtube.html @@ -1,11 +1,9 @@ -{{ $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="{{ .context.video.poster }}" alt="{{ .context.video_title }}" loading="lazy"> - </div> -{{ end }} +<div class="lazy-video-player"> + <button class="lazy-video-player__play" title ="{{- i18n "blocks.video.play" -}}" aria-label="{{- i18n "blocks.video.play" -}}"></button> + {{ if .video.poster }} + <img src="{{ .video.poster }}" alt="{{ .video.title }}" loading="lazy"> + {{ end }} +</div> <div class="video-container"> - <iframe data-unloaded-src="{{ .context.video.embed_with_defaults }}" title="{{ $title }}" allowfullscreen allow="autoplay"></iframe> + <iframe data-unloaded-src="{{ .video.embed_with_defaults }}" title="{{ video.title }}" allowfullscreen allow="autoplay"></iframe> </div> \ No newline at end of file -- GitLab