From d3a7367083e3382ba9898b03dffa2d9b17cff44d Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Sun, 09 Jul 2023 16:04:04 +0000
Subject: [PATCH] patch #114

---
 layouts/shortcodes/liteyoutube.html |   31 ++++++++++++-------------------
 1 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/layouts/shortcodes/liteyoutube.html b/layouts/shortcodes/liteyoutube.html
index c9e5799..eadcd07 100644
--- a/layouts/shortcodes/liteyoutube.html
+++ b/layouts/shortcodes/liteyoutube.html
@@ -1,23 +1,16 @@
-{{ if .IsNamedParams }}
-  {{ $videoid := .Get "videoid" }} <!-- required. -->
-  {{ $img := .Get "img" }} <!-- not required. The initial background image instead of a generated one. -->
+<div class="video">
+  {{- $videoid := .Get 0 -}}
+  {{- $img := .Get 1 -}}
+  {{- $params := .Get 2 -}}
   {{ $bkImg := "" }}
-  {{ $params := .Get "params" }} <!-- not required. List of params here: https://developers.google.com/youtube/player_parameters -->
+  {{ if .IsNamedParams }}
+    {{ $videoid = .Get "videoid" }}
+    {{ $img = .Get "img" }}
+    {{ $bkImg = "" }}
+    {{ $params = .Get "params" }}
+  {{ end }}
   {{ with $img }}
     {{ $bkImg := absURL (printf "images/%s" .) }}
-    <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
-  {{ else }}
-    <lite-youtube videoid="{{$videoid}}"{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
   {{ end }}
-{{ else }}
-  {{- $videoid := .Get 0 -}} <!-- required. -->
-  {{- $img := .Get 1 -}} <!-- not required. The initial background image instead of a generated one. -->
-  {{- $params := .Get 2 -}} <!-- not required. List of params here: https://developers.google.com/youtube/player_parameters -->
-  {{ $bkImg := "" }}
-  {{ with $img }}
-    {{ $bkImg := absURL (printf "images/%s" .) }}
-    <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
-  {{ else }}
-    <lite-youtube videoid="{{$videoid}}"{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
-  {{ end }}
-{{ end }}
+  <lite-youtube videoid="{{ $videoid }}"{{ with $bkImg }} style="background-image: url({{ . }})"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
+</div>

--
Gitblit v1.10.0