From 0e37d8ea2e7fc68859be9ce5b1dabaaca65309fa Mon Sep 17 00:00:00 2001
From: Ray <rwstorer@hotmail.com>
Date: Sun, 11 Jun 2023 01:47:15 +0000
Subject: [PATCH] added bkImg var

---
 layouts/shortcodes/liteyoutube.html |    5 ++++-
 exampleSite/go.sum                  |    2 ++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/exampleSite/go.sum b/exampleSite/go.sum
index 602940c..df6ad41 100644
--- a/exampleSite/go.sum
+++ b/exampleSite/go.sum
@@ -34,3 +34,5 @@
 github.com/rwstorer/hugo-theme-compose v0.0.0-20230611011250-29764d3cdc54/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
 github.com/rwstorer/hugo-theme-compose v0.0.0-20230611013609-aeaea2852b98 h1:9pYay6P/mUgA31ANPqFQBjGI809JhN1Li/umaFeFhIE=
 github.com/rwstorer/hugo-theme-compose v0.0.0-20230611013609-aeaea2852b98/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
+github.com/rwstorer/hugo-theme-compose v0.0.0-20230611013841-e25e31add480 h1:m+9tc/4S8keQy3IhvdtzlZf0T2rW8LIHBkTD6qS40kM=
+github.com/rwstorer/hugo-theme-compose v0.0.0-20230611013841-e25e31add480/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
diff --git a/layouts/shortcodes/liteyoutube.html b/layouts/shortcodes/liteyoutube.html
index 8330068..460d627 100644
--- a/layouts/shortcodes/liteyoutube.html
+++ b/layouts/shortcodes/liteyoutube.html
@@ -1,4 +1,7 @@
 {{ $videoid := .Get "videoid" }}
 {{ $params := .Get "params" }} <!-- not required. List of params here: https://developers.google.com/youtube/player_parameters -->
 {{ $img := .Get "img"}} <!-- not required. The initial background image instead of a generated one. -->
-<lite-youtube videoid="{{$videoid}}"{{ if $img }} style="background-image: url('{{absURL (printf `images/%s` $img)}}`)"{{ end }}{{ if $params }} params="{{$params}}"{{ end }}></lite-youtube>
\ No newline at end of file
+{{ if $img }}
+  {{ $bkImg := absURL (printf "images/%s" $img) }}
+{{ end }}
+<lite-youtube videoid="{{$videoid}}"{{ if $img }} style="background-image: url('{{$bkImg}}')"{{ end }}{{ if $params }} params="{{$params}}"{{ end }}></lite-youtube>
\ No newline at end of file

--
Gitblit v1.10.0