From 94c4e4a2ed0853134d80954a9c3b16a652af8451 Mon Sep 17 00:00:00 2001 From: Olivia206 <olivia.simonet206@gmail.com> Date: Tue, 10 Oct 2023 17:33:24 +0200 Subject: [PATCH] fixed image style --- assets/sass/_theme/blocks/video.sass | 4 +++- layouts/partials/blocks/templates/video.html | 5 ++++- layouts/partials/head/csp.html | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/assets/sass/_theme/blocks/video.sass b/assets/sass/_theme/blocks/video.sass index f7b9fddc..8d698116 100644 --- a/assets/sass/_theme/blocks/video.sass +++ b/assets/sass/_theme/blocks/video.sass @@ -2,7 +2,8 @@ .video @include aspect-ratio(16/9, 'iframe') @supports not (aspect-ratio: 1) - iframe + iframe, + img min-height: 400px position: relative &-player @@ -22,6 +23,7 @@ width: 100% height: 100% img + object-fit: cover z-index: 1 &::after content: '' diff --git a/layouts/partials/blocks/templates/video.html b/layouts/partials/blocks/templates/video.html index 072a837a..6a33257b 100644 --- a/layouts/partials/blocks/templates/video.html +++ b/layouts/partials/blocks/templates/video.html @@ -16,7 +16,10 @@ <div class="video"> <div class="video-player"> <button class="video-player__play" title ="{{- i18n "blocks.video.play" -}}" aria-label="{{- i18n "blocks.video.play" -}}"></button> - <img src="https://img.youtube.com/vi/XEEUOiTgJL0/hqdefault.jpg" alt=""> + <picture> + <source srcset="https://osuny-1b4da.kxcdn.com/g1qn3b0yvdg2t0wosq059xocpyq1?format=webp&width=1800&height=0&&fit=inside&quality=50" type="image/jpg" /> + <img src="https://osuny-1b4da.kxcdn.com/g1qn3b0yvdg2t0wosq059xocpyq1?format=webp&width=1800&height=0&&fit=inside&quality=50" alt="" /> + </picture> </div> {{ $url := .url}} {{ if strings.Contains $url "vimeo" }} diff --git a/layouts/partials/head/csp.html b/layouts/partials/head/csp.html index 8f7ac79c..de1b2d94 100644 --- a/layouts/partials/head/csp.html +++ b/layouts/partials/head/csp.html @@ -1,5 +1,5 @@ {{- with site.Data.website.external_domains -}} -<meta http-equiv="-Content-Security-Policy" +<meta http-equiv="Content-Security-Policy" content=" default-src 'self' {{ delimit . " " }} {{ if not hugo.IsProduction }}'unsafe-inline'{{ end }} -- GitLab