From 7c57127c2f46f5d834a4173274540d82740519d9 Mon Sep 17 00:00:00 2001
From: Ray <rwstorer@hotmail.com>
Date: Sun, 11 Jun 2023 03:33:47 +0000
Subject: [PATCH] a kluge to see what happens

---
 layouts/shortcodes/liteyoutube.html |   16 +++++++++-------
 exampleSite/go.sum                  |    2 ++
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/exampleSite/go.sum b/exampleSite/go.sum
index 338af6d..e06e87b 100644
--- a/exampleSite/go.sum
+++ b/exampleSite/go.sum
@@ -46,3 +46,5 @@
 github.com/rwstorer/hugo-theme-compose v0.0.0-20230611030846-a91f59280bbb/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
 github.com/rwstorer/hugo-theme-compose v0.0.0-20230611031132-ddffdf7dde93 h1:TtzPjBvXJjWYhqPDFumnS4xDFVfAlJEXBFuuhoBK4/U=
 github.com/rwstorer/hugo-theme-compose v0.0.0-20230611031132-ddffdf7dde93/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
+github.com/rwstorer/hugo-theme-compose v0.0.0-20230611031251-11099f76fce2 h1:tWGK7hU0ptbaehbGSlvGpJQHvSUW6ksvBD5SGKqvFWI=
+github.com/rwstorer/hugo-theme-compose v0.0.0-20230611031251-11099f76fce2/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
diff --git a/layouts/shortcodes/liteyoutube.html b/layouts/shortcodes/liteyoutube.html
index ec22bbc..d0d37b6 100644
--- a/layouts/shortcodes/liteyoutube.html
+++ b/layouts/shortcodes/liteyoutube.html
@@ -1,13 +1,15 @@
 {{ if .IsNamedParams }}
   {{ $videoid := .Get "videoid" }} <!-- required. -->
   {{ $img := .Get "img" }} <!-- not required. The initial background image instead of a generated one. -->
+  {{ $bkImg := "" }}
   {{ $params := .Get "params" }} <!-- not required. List of params here: https://developers.google.com/youtube/player_parameters -->
-  {{ with $img }} {{ $img := absURL (printf "images/%s" $img) }} {{ end }}
-  <lite-youtube videoid="{{$videoid}}"{{ with $img }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
+  {{ with $img }} {{ $bkImg := absURL (printf "images/%s" $img) }} {{ end }}
+  <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
 {{ 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 -->
-  {{ with $img }} {{ $img := absURL (printf "images/%s" $img) }} {{ end }}
-  <lite-youtube videoid="{{$videoid}}"{{ with $img }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
+  {{- $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" $img) }} {{ end }}
+  <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
 {{ end }}

--
Gitblit v1.10.0