From 1ae2e3d6a2af3b6175ff93ac27954b5cda9572c7 Mon Sep 17 00:00:00 2001
From: Ray <rwstorer@hotmail.com>
Date: Sun, 11 Jun 2023 04:27:16 +0000
Subject: [PATCH] more debug

---
 layouts/shortcodes/liteyoutube.html |   24 ++++++++++++++++--------
 exampleSite/go.mod                  |    4 +---
 exampleSite/go.sum                  |    2 ++
 3 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/exampleSite/go.mod b/exampleSite/go.mod
index 2ec6d17..04d1339 100644
--- a/exampleSite/go.mod
+++ b/exampleSite/go.mod
@@ -2,6 +2,4 @@
 
 go 1.15
 
-require (
-
-)
+require github.com/rwstorer/hugo-theme-compose v0.0.0-20230611041900-16c2ce96ef5a // indirect
diff --git a/exampleSite/go.sum b/exampleSite/go.sum
index 4dd00b6..f434943 100644
--- a/exampleSite/go.sum
+++ b/exampleSite/go.sum
@@ -56,3 +56,5 @@
 github.com/rwstorer/hugo-theme-compose v0.0.0-20230611035253-44d4e6b24d65/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
 github.com/rwstorer/hugo-theme-compose v0.0.0-20230611040011-726a11f5e7b8 h1:lpduewP+0F23NVASVa7WJ96JNxFfWeeKUybWjFhfSac=
 github.com/rwstorer/hugo-theme-compose v0.0.0-20230611040011-726a11f5e7b8/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
+github.com/rwstorer/hugo-theme-compose v0.0.0-20230611041900-16c2ce96ef5a h1:O5zmkIshvR3RKLwxxDhFOXz1RGvsF23KAv9MrCxBrPc=
+github.com/rwstorer/hugo-theme-compose v0.0.0-20230611041900-16c2ce96ef5a/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
diff --git a/layouts/shortcodes/liteyoutube.html b/layouts/shortcodes/liteyoutube.html
index 40d6fb7..a9a4723 100644
--- a/layouts/shortcodes/liteyoutube.html
+++ b/layouts/shortcodes/liteyoutube.html
@@ -3,17 +3,25 @@
   {{ $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 }} {{ $bkImg := absURL (printf "images/%s" $img) }} {{ end }}
-  <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
-  {{ printf "img = [{{$img}}]" }}
-  {{ printf "bkImg = [{{$bkImg}}]" }}
+  {{ with $img }}
+    {{ $bkImg := absURL (printf "images/%s" $img) }}
+    {{ printf "named img = [%s]" $img }}
+    {{ printf "named bkImg = [%s]" $bkImg}}  
+    <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" $img) }} {{ end }}
-  <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
-  {{ printf "img = [%s]" $img }}
-  {{ printf "bkImg = [%s]" $bkImg }}
+  {{ with $img }}
+    {{ $bkImg := absURL (printf "images/%s" $img) }}
+    {{ printf "pos img = [%s]" $img }}
+    {{ printf "pos bkImg = [%s]" $bkImg}}  
+    <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 }}

--
Gitblit v1.10.0